Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

A way to automate text for an XML file

Featured Replies

I usually just write a C# Console app to do that sort of thing :->Something along the lines of:

string[] digits = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };for (int hdg=1; hdg <= 360; hdg++){	Console.WriteLine("<P WEIGHT="0.01">heading {0} {1} {2}</P>",		digits[hdg / 100],		digits[(hdg % 100) / 10],		digits[hdg % 10]);}

I typed that in off the top of my head, so no assurance it will actually compile as is :->Tim

  • Author
  • Commercial Member

Thanks Beattle,If any of you are using Blitzmax, you can use this code:

SuperStrictLocal num:String[] = New String[11]num[0] = "zero"num[1] = "one"num[2] = "two"num[3] = "three"num[4] = "four"num[5] = "five"num[6] = "six"num[7] = "seven"num[8] = "eight"num[9] = "nine"num[10] = "ten"Local fs:TStream = WriteFile("out.xml")For Local ang:Int = 1 To 360		Local as:String = String(ang)		Local str:String		If Len(as) > 2				Local one:String = Left(as, 1)		Local two:String = Mid(as, 1, 1)		Local three:String = Right(as, 1)				str = num[int(one)] + " " + num[int(two)] + " " + num[int(three)]		Else If Len(as) > 1			Local one:String = Left(as, 1)		Local two:String = Right(as, 1)			str = "zero " + num[int(one)] + " " + num[int(two)]		Else			str = "zero zero " + num[int(ang)]		EndIf	fs.WriteLine("<P WEIGHT=~q0.01~q>heading " + str + "</P>")	NextCloseFile fs

  • Author
  • Commercial Member

All right, this code should work:

SuperStrictLocal num:String[] = New String[11]num[0] = "zero"num[1] = "one"num[2] = "two"num[3] = "three"num[4] = "four"num[5] = "five"num[6] = "six"num[7] = "seven"num[8] = "eight"num[9] = "nine"num[10] = "ten"Local fs:TStream = WriteFile("out.xml")For Local ang:Int = 1 To 360		Local as:String = String(ang)		Local str:String	Print "Ang:" + ang + " L:" + Len(as)	If Len(as) > 2				Local one:String = Left(as, 1)		Local two:String = Mid(as, 2, 1)		Local three:String = Right(as, 1)		Print "O:" + one + " T:" + TWO + " THREE:" + three						str = num[int(one)] + " " + num[int(two)] + " " + num[int(three)]			Else If Len(as) > 1			Local one:String = Left(as, 1)		Local two:String = Right(as, 1)			str = "zero " + num[int(one)] + " " + num[int(two)]		Else			str = "zero zero " + num[int(ang)]		EndIf	fs.WriteLine("<P WEIGHT=~q0.01~q>heading " + str + "</P>")	NextCloseFile fs

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.