Jump to content

Archived

This topic is now archived and is closed to further replies.

Propwash

Storing String Data

Recommended Posts

What's the best way to store string data?Building off of the (COM1 Ident, string)? thread, once gps data are retrieved, what's the best way to store the information, specifically the string info? I would like to search for more than just the nearest airport that uses a particular frequency, and return information about, say, the nearest 5 airports. Something like (searching 122.10 mhz whilst at O'Hare) AIRPORT____TYPE_____NM______BRG KDPA_______FSS______17______257 KLOT_______FSS______24______204 KARR_______FSS______29______246 -C18_______FSS______30______176 KGYY_______FSS______31______135and display the five lines of information at the same time, without deleting the previous match when the gps query finds a new one.The gps search code is not the problem; it's the display of the previous queries, and numbers are easy ... but the strings are a little different. Is there a better, perhaps more elegant way to remember the string data than the symb – ord - chr approach? (@c:WaypointAirportIdent) 0 symb ord (>L:IdentChar0,number) (@c:WaypointAirportIdent) 1 symb ord (>L:IdentChar1,number) (@c:WaypointAirportIdent) 2 symb ord (>L:IdentChar2,number) <String>%((L:IdentChar0,number) chr (L:IdentChar1,number) chr scat (L:IdentChar2,number) chr scat)%!s!</String> Many thanks, Bob

Share this post


Link to post
Share on other sites

Bob, unfortunately no. No real elegant way. BTW I updated the code a whole bunch, its in the previous topic we were at. Kinda looks like we were in the same boat.Done for today:Party: getting closer to kickoff!Roman

Share this post


Link to post
Share on other sites

I have been working with strings and remembered this old thread. I finally discovered that which many people, I'm sure, have known forever - strings can be stored, momentarily, in internal registers. So, if you can make use of store and load within one Update cycle, it works, and you may be able to avoid the repetitious use of string operators symb, ord, chr, scat and L:Vars. Bob

Share this post


Link to post
Share on other sites

Bob, Wow! This digs up an old topic (Oct./Nov 2010) where you needed to get the 5 nearest matching Comm frequencies, give type and bearing/distance. The following full code is my 9th complete retry of this little project. It is unfinished and just a hypothesis / brain teaser . The remaining "TODO" section is labeled "BUBBLE SORT BASED ON GEOCALC DISTANCE" & is commented out. That section was for when you are approaching a comm station then pass it it will resort the results before the database query finishes. A database timing result chart is below. Anyway, if you look at the Macro's named "s2d" & "d2s" you can find that I used this to store a 4 digit string into just 1 L:Var. BTW G:Vars 4-6 are missing! Where did they go? Thinking.gif LOL! They where part of a test routine to time the database for a full search. Use this as you wish, I am basically done with it as I donot remember what I did Hypnotized.gif LOL! Maybe there is something in here you can use. I just threw this into FS9 Mooney for a test, it does work except for the bubble sort. BTW the best test routine I have found is to fly around KORD (40 NM radius) w/ comm set to 118.40 & for a good sort test head to KDTW on same freq. then return. . Roman

 <Gauge Name="COMM5" Version="1.0"> <Element Name="BACKGROUND"><Rectangle Width="151" Height="128" FillColor="#b7b7b7" LineWidth="4" Color="#7f7f7f" Bright="Yes"/></Element><Element><Position X="0" Y="0"/><Circle Radius="4" FillColor="Black" Bright="Yes"/></Element><Element><Position X="143" Y="0"/><Circle Radius="4" FillColor="Black" Bright="Yes"/></Element><Element><Position X="0" Y="120"/><Circle Radius="4" FillColor="Black" Bright="Yes"/></Element><Element><Position X="143" Y="120"/><Circle Radius="4" FillColor="Black" Bright="Yes"/></Element> <!-- GENERAL OR GPS SYSYTEM MACROS --><Macro Name="c">C:fs9gps</Macro><Macro Name="com">(A:COM2 STANDBY FREQUENCY, MHZ) (A:COM1 STANDBY FREQUENCY, MHZ) (A:COM2 ACTIVE FREQUENCY, MHZ) (A:COM1 ACTIVE FREQUENCY, MHZ) 4 (L:COMMSELECT, number) case</Macro><Macro Name="reset">0 (>G:Var2) 0 (>@c:NearestAirportCurrentLine) 0 (>@c:WaypointAirportCurrentFrequency) @timer</Macro><Macro Name="nearcurr">(@c:NearestAirportCurrentLine)</Macro><Macro Name="apt_match">@ident (@c:NearestAirportCurrentIdent) s1 @sc l1 slen 0 != and</Macro><Macro Name="apt_inc">@nearcurr (@c:NearestAirportItemsNumber) 1 - > if{ (G:Var2) (>G:Var3) @reset } els{ 0 (>@c:WaypointAirportCurrentFrequency) @nearcurr ++ (>@c:NearestAirportCurrentLine) }</Macro><Macro Name="los">(A:RADIO HEIGHT, feet) 2 * sqrt 0 max 7 + near</Macro><Macro Name="ident">(@c:WaypointAirportIdent)</Macro><Macro Name="type">(@c:WaypointAirportFrequencyName)</Macro><Macro Name="lat">L:Lat@1, number</Macro><Macro Name="lon">L:Lon@1, number</Macro><Macro Name="aptlat">(@c:WaypointAirportLatitude, radians)</Macro><Macro Name="aptlon">(@c:WaypointAirportLongitude, radians)</Macro><Macro Name="gpslat">(A:GPS POSITION LAT, radians)</Macro><Macro Name="gpslon">(A:GPS POSITION LON, radians)</Macro><Macro Name="geocalc">@1 (>@c:GeoCalcLatitude2, radians) @2 (>@c:GeoCalcLongitude2, radians)</Macro><Macro Name="geodis">(@c:GeoCalcDistance, nmiles)</Macro><!-- !!! USER OPTION !!! - TO HAVE "TRUE" BEARING REMOVE "(A:GPS MAGVAR, degrees) - " --><Macro Name="geobrg">(@c:GeoCalcBearing, degrees) (A:GPS MAGVAR, degrees) - d360 near</Macro><Macro Name="fndct">(G:Var2) -- s1 (>G:Var2) l1 (G:Var3) max (>G:Var3)</Macro><Macro Name="eof">(@c:WaypointAirportCurrentFrequency) (@c:WaypointAirportFrequenciesNumber) 1 - > (@c:WaypointAirportFrequencyType) 1 > ||</Macro><Macro Name="idxmtch">@nearcurr (L:Inx, number) ==</Macro><Macro Name="timer">(G:Var4) 0 != if{ (E:ABSOLUTE TIME, minutes) (G:Var4) - (>G:Var5) } (E:ABSOLUTE TIME, minutes) (>G:Var4)</Macro><Macro Name="ap">L:ap@1, number</Macro> <!-- STRING MANIPULATOR & STORAGE MACROS --><Macro Name="s2d">0 symb ord + 100 * l1 1 symb ord + 100 * l1 2 symb ord + 100 * l1 3 symb ord +</Macro><Macro Name="d2s">@1 0.000001 * flr chr @1 0.0001 * flr @1 0.000001 * flr 100 * - chr scat @1 0.01 * flr @1 0.0001 * flr 100 * - chr scat @1 d 0.01 * flr 100 * - flr chr scat</Macro><Macro Name="sc">scmi 0 ==</Macro><Macro Name="repl">@type s1 'Approach' @sc if{ 'APPR' s1 } l1 'Unicom' @sc if{ 'UCOM' s1 } l1 'Clearance' @sc if{ 'CLRD' s1 } l1 'Ground' @sc if{ ' GND' s1 } l1 'Tower' @sc if{ ' TWR' s1 } l1 'Departure' @sc if{ ' DEP' s1 } l1 'Center' @sc if{ ' CTR' s1 } l1 'Multicom' @sc if{ 'MCOM' s1 } l1 @s2d</Macro><Macro Name="myident">L:Ident@1, number</Macro><Macro Name="mytype">L:Type@1, number</Macro><Macro Name="duptype">L:Duptype@1, number</Macro><Macro Name="adddup">' / ' scat @d2s(l1) scat</Macro>  <!-- TEAR APART THE FOUND STATION/TYPE, MODIFY TYPE, AND STORE THEM IN WORD REGISTERS, SAVE LAT/LON, SET THE CURRENT INDEX FOR DUPLICATE MATCH --><Macro Name="set">  @1 1 == if{ @ident s1 @s2d (>@myident(1)) @repl (>@mytype(1)) @aptlat (>@lat(1)) @aptlon (>@lon(1)) }@1 2 == if{ @ident s1 @s2d (>@myident(2)) @repl (>@mytype(2)) @aptlat (>@lat(2)) @aptlon (>@lon(2)) }@1 3 == if{ @ident s1 @s2d (>@myident(3)) @repl (>@mytype(3)) @aptlat (>@lat(3)) @aptlon (>@lon(3)) }@1 4 == if{ @ident s1 @s2d (>@myident(4)) @repl (>@mytype(4)) @aptlat (>@lat(4)) @aptlon (>@lon(4)) }@1 5 == if{ @ident s1 @s2d (>@myident(5)) @repl (>@mytype(5)) @aptlat (>@lat(5)) @aptlon (>@lon(5)) }@nearcurr (>L:Inx, number)</Macro> <!-- DONOT ALLOW A DUPLICATE AIRPORT TO BE LOADED IN QUEUE --><Macro Name="check">@ident s1 @s2d s1 (@myident(1)) == l1 (@myident(2)) == l1 (@myident(3)) == l1 (@myident(4)) == l1 (@myident(5)) == || || || || ! if{ @set((G:Var2)) } els{ @nearcurr (>L:Inx, number) }</Macro> <!-- IF @ NEXT LINE, TYPE FOUND & THIS IDENT = THE PREVIOUS, MODIFY TYPE, STORE DUPLICATE TYPE & DECREMENT FOUND LINE # --><Macro Name="dupl">@1 1 == if{ @check }@1 2 == if{ @idxmtch if{ @fndct @repl (>@duptype(1)) } els{ @check } }@1 3 == if{ @idxmtch if{ @fndct @repl (>@duptype(2)) } els{ @check } }@1 4 == if{ @idxmtch if{ @fndct @repl (>@duptype(3)) } els{ @check } }@1 5 == if{ @idxmtch if{ @fndct @repl (>@duptype(4)) } els{ @check } }@1 6 == if{ @idxmtch if{ @fndct @repl (>@duptype(5)) } els{ @check } }</Macro> <Update> <!-- RESET ALL ON COM CHANGE -->  @com s1 (G:Var1) != if{ l1 (>G:Var1) @reset 0 (>G:Var3) } <!-- TELL GPS SYSTEM WHERE YOU ARE --><!-- !!! OPTIMIZED !!! MAYBE..... GPS LAT/LON UPDATES MUCH SLOWER THAN PLANE LAT/LON, IT MAY GIVE RELIEF TO GPS SYSTEM, FOR THIS USE OF GPS SYSTEM IT SHOULD HAVE NO ILL EFFECTS ON HOW THIS CODE WORKS -->@gpslat (>@c:NearestAirportCurrentLatitude, radians)@gpslon (>@c:NearestAirportCurrentLongitude, radians) <!-- DYNAMICALLY SET UP DATABASE FOR NEAREST AIRPORT SEARCH -->@los (>@c:NearestAirportMaximumDistance, NMiles)@los 11 * (>@c:NearestAirportMaximumItems) <!-- IF WAYPOINT = CURRENT NEAREST, IS VALID AND FREQ. MATCHES, STORE IDENTS, CHECK FOR DUPLICATES, INCREMENT TO NEXT. --><!-- !!! USER OPTION !!! - TO TURN OFF DUPLICATE DISPLAY, CHANGE "@dupl((G:Var2))" TO "@set((G:Var2))"  AND VICE VERSA -->@apt_match (@c:WaypointAirportFrequencyValue, Mhz) @com == and if{ (G:Var2) ++ (>G:Var2) @dupl((G:Var2)) (G:Var2) (G:Var3) max (>G:Var3) } <!-- IF WAYPOINT = CURRENT NEAREST AND IS VALID, INCREMENT FREQS. UNTIL LAST, THEN INCREMENT AIRPORT --><!-- !!! OPTIMIZED !!! - DOES NOT CYCLE THROUGH NAV FREQS., ONCE THOSE ARE FOUND IT INCREMENTS AIRPORT  -->  @apt_match if{ @eof if{ @apt_inc } els{ (@c:WaypointAirportCurrentFrequency) ++ (>@c:WaypointAirportCurrentFrequency) } } <!-- IF WAYPOINT IS NOT LOADED KEEP TRYING --><!-- !!! OPTIMIZED !!! - DOES NOT LOAD AIRPORTS THAT DONOT HAVE RADIO OR NON HARD SURFACE AIRPORTS INSTEAD INCREMENTS AIRPORT  --><!-- !!! USER OPTION !!! - TO INCLUDE SOFT SURFACE AIRPORTS, REMOVE "(@c:NearestAirportCurrentAirportKind) 1 == and "  -->@apt_match ! if{ (@c:NearestAirportCurrentComFrequencyValue) 0 != (@c:NearestAirportCurrentAirportKind) 1 == and if{ (@c:NearestAirportCurrentICAO) (>@c:WaypointAirportICAO) } els{ @apt_inc } }  <!-- CONSTANT UPDATE FOR DISPLAY DRAW -->(G:Var3) s1@gpslat (>@c:GeoCalcLatitude1, radians) @gpslon (>@c:GeoCalcLongitude1, radians) <!-- CALCULATE/UPDATE DISTANCE AND BEARING, IF NONE, CLEAR STRING REGISTER, AP HEADING STORAGE AND CLEARING -->l1 0 > if{ @geocalc((L:Lat1, number),(L:Lon1, number)) @geodis s12 @geobrg s13 } els{ ' ' s12 ' ' s13 }l1 1 > if{ @geocalc((L:Lat2, number),(L:Lon2, number)) @geodis s14 @geobrg s15 } els{ ' ' s14 ' ' s15 }l1 2 > if{ @geocalc((L:Lat3, number),(L:Lon3, number)) @geodis s16 @geobrg s17 } els{ ' ' s16 ' ' s17 }l1 3 > if{ @geocalc((L:Lat4, number),(L:Lon4, number)) @geodis s18 @geobrg s19 } els{ ' ' s18 ' ' s19 }l1 4 > if{ @geocalc((L:Lat5, number),(L:Lon5, number)) @geodis s20 @geobrg s21 } els{ ' ' s20 ' ' s21 } <!-- RESET THE WORD DIGIT HOLDERS & BRG/DIST IF NOTHING AT "CURRENT" GVAR3 IS FOUND THAT MATCHES, OR @ RESET. ELSE REBUILD "IDENT" & "TYPE" INTO FULL STRINGS -->l1 5 < if{ 0 (>@myident(5)) 0 (>@mytype(5)) 0 (>@duptype(5)) ' ' s10 ' ' s11 } els{ @d2s((L:Ident5, number)) s10 @d2s((L:Type5, number)) s11 }l1 4 < if{ 0 (>@myident(4)) 0 (>@mytype(4)) 0 (>@duptype(4)) ' ' s8 ' ' s9 } els{ @d2s((L:Ident4, number)) s8 @d2s((L:Type4, number)) s9 }l1 3 < if{ 0 (>@myident(3)) 0 (>@mytype(3)) 0 (>@duptype(3)) ' ' s6 ' ' s7 } els{ @d2s((L:Ident3, number)) s6 @d2s((L:Type3, number)) s7 }l1 2 < if{ 0 (>@myident(2)) 0 (>@mytype(2)) 0 (>@duptype(2)) ' ' s4 ' ' s5 } els{ @d2s((L:Ident2, number)) s4 @d2s((L:Type2, number)) s5 }l1 0 == if{ 0 (>@myident(1)) 0 (>@mytype(1)) 0 (>@duptype(1)) ' ' s2 ' ' s3 } els{ @d2s((L:Ident1, number)) s2 @d2s((L:Type1, number)) s3 } <!-- IF DUPLICATE STATION TYPE IS FOUND ADD TO ORIGINAL "TYPE" STRING -->(@duptype(1)) s1 0 > if{ l3 @adddup s3 }(@duptype(2)) s1 0 > if{ l5 @adddup s5 }(@duptype(3)) s1 0 > if{ l7 @adddup s7 }(@duptype(4)) s1 0 > if{ l9 @adddup s9 }(@duptype(5)) s1 0 > if{ l11 @adddup s11 } <!-- BUBBLE SORT BASED ON GEOCALC DISTANCE --><!-- 		| 	IDENT   	|        TYPE    | 	DISTANCE   	|        BEARING      | 	AP STORE      |l23 l22 < if{ l2 s27 l4 s2 l27 s4 l3 s28 l5 s3 l28 s5 l12 s29 l14 s12 l29 s14 l13 s30 l15 s13 l30 s15 l32 s31 l33 s32 l31 s33 }l24 l23 < if{ l2 s27 l4 s2 l27 s4 l3 s28 l5 s3 l28 s5 l12 s29 l14 s12 l29 s14 l13 s30 l15 s13 l30 s15 l32 s31 l33 s32 l31 s33 } -- Or something like this...   l25 l24 < if{ l6 sp27 l6 s8 l27 s6 l7 sp28 l7 s9 l28 s7 l16 sp29 l16 s18 l29 s16 l17 sp30 l17 s19 l30 s17 }l26 l25 < if{ l8 sp27 l8 s10 l27 s8 l9 sp28 l19 s11 l28 s9 l18 sp29 l18 s20 l29 s18 l19 sp30 l19 s21 l30 s19 } --> <!-- SORTED AP RAW BEARING STORE -->l13 (>@ap(1)) l15 (>@ap(2)) l17 (>@ap(3)) l19 (>@ap(4)) l21 (>@ap(5)) <!-- ADD DESCRIPTORS TO DISTANCE AND BEARING AFTER SORTING -->(G:Var3) s1l1 0 > if{ l12 near ' nm' scat s12 l13 '°' scat s13 }l1 1 > if{ l14 near ' nm' scat s14 l15 '°' scat s15 }l1 2 > if{ l16 near ' nm' scat s16 l17 '°' scat s17 }l1 3 > if{ l18 near ' nm' scat s18 l19 '°' scat s19 }l1 4 > if{ l20 near ' nm' scat s20 l21 '°' scat s21 } <!-- RESET LOOPING SEARCH -->@eof (G:Var2) 5 == and (G:Var2) 6 == || if{ @reset } </Update> <Element Name="DISPLAY WITH DIAGNOSTICS"><Position X="5" Y="5"/><FormattedText X="140" Y="117" Font="Arial" FontSize="7" VerticalAdjust="Center" BackgroundColor="#575757" Color="Yellow" Bright="Yes"><String>%\{tabs=72C}%((L:COMMSELECT, number))%\{ul}%{case}%{:0}%COMM 1 ACTIVE%{:1}%COMM 2 ACTIVE%{:2}%COMM 1 STANDBY%{:3}%COMM 2 STANDBY%{end}%\{nr}%\n%\{clr=Orange}%\n%\{tabs=13L,43L,88L,115L}%\{ul}%ARPT%\t% 	TYPE 	%\t% DIST %\t%BRG%\{nr}%\n%\{tabs=9L,59C,97C,122C}%- %(l2)%!s!%\t%(l3)%!s!%\t%(l12)%!s!%\t%(l13)%!s!%\n%\{tabs=9L,59C,97C,122C}%- %(l4)%!s!%\t%(l5)%!s!%\t%(l14)%!s!%\t%(l15)%!s!%\n%\{tabs=9L,59C,97C,122C}%- %(l6)%!s!%\t%(l7)%!s!%\t%(l16)%!s!%\t%(l17)%!s!%\n%\{tabs=9L,59C,97C,122C}%- %(l8)%!s!%\t%(l9)%!s!%\t%(l18)%!s!%\t%(l19)%!s!%\n%\{tabs=9L,59C,97C,122C}%- %(l10)%!s!%\t%(l11)%!s!%\t%(l20)%!s!%\t%(l21)%!s!%\n%\{clr=Black}%\{line=140}%\n%\{tabs=8L,75L}%DB Range %((@c:NearestAirportMaximumDistance, NMiles))%!d! nm%\t%DB Max Items %((@c:NearestAirportMaximumItems))%!d!%\n%\{tabs=8L,75L}%Nearest Index %(@nearcurr)%!d!%\t%DB Total %((@c:NearestAirportItemsNumber))%!d!%\n%%\{tabs=8L,75L}%Waypoint Loaded %(@apt_match)%!d!%\t%Waypt Freq Index %((@c:WaypointAirportCurrentFrequency))%!d!%\n%\{tabs=8L,75L}%DB Time %((G:var6))%!5.2f!% min%\t%# Found (2) %((G:Var2))%!d!%</String></FormattedText></Element> <Mouse><Area Name="COMM SELECT TOGGLE" Left="52" Top="5" Width="40" Height="20"><Cursor Type="Hand"/><Click Repeat="No">(L:COMMSELECT, number) ++ s1 4 == if{ 0 (>L:COMMSELECT, number) } els{ l1 (>L:COMMSELECT, number) }</Click></Area> <Area Name="DIRECT HEADING 1" Left="118" Top="33" Width="15" Height="7"><Visible>(G:Var3) 0 ></Visible><Cursor Type="Hand"/><Click Repeat="No">(@ap(1)) (>K:HEADING_BUG_SET)</Click></Area> <Area Name="DIRECT HEADING 2" Left="118" Top="41" Width="15" Height="7"><Visible>(G:Var3) 1 ></Visible><Cursor Type="Hand"/><Click Repeat="No">(@ap(2)) (>K:HEADING_BUG_SET)</Click></Area> <Area Name="DIRECT HEADING 3" Left="118" Top="49" Width="15" Height="7"><Visible>(G:Var3) 2 ></Visible><Cursor Type="Hand"/><Click Repeat="No">(@ap(3)) (>K:HEADING_BUG_SET)</Click></Area> <Area Name="DIRECT HEADING 4" Left="118" Top="57" Width="15" Height="7"><Visible>(G:Var3) 3 ></Visible><Cursor Type="Hand"/><Click Repeat="No">(@ap(4)) (>K:HEADING_BUG_SET)</Click></Area> <Area Name="DIRECT HEADING 5" Left="118" Top="65" Width="15" Height="7"><Visible>(G:Var3) 4 ></Visible><Cursor Type="Hand"/><Click Repeat="No">(@ap(5)) (>K:HEADING_BUG_SET)</Click></Area> <Area Name="TESTING RESET" Left="0" Top="101" Width="50" Height="50"><Cursor Type="Hand"/><Click Repeat="No">(>K:RELOAD_PANELS)</Click></Area></Mouse></Gauge>

NOTES & TESTING RESULTS ETC....

 <!-- STATIC UPDATE RATE -->TESTED @ KORD, 20 FPS, MINIMAL GRAPHICS SETTINGS, CLEAR WX, NO AI, PAUSED --------------------------------------------------------------------------------------------------------------------TIME FOR FULL DB SEARCHALTITUDE | RANGE |  MAX DB | TOTAL |  W/RADIO & HARD SURFACE | W/RADIO ONLY |  W/RADIO & HARD SURFACE | W/RADIO ONLY---------------------------------------------------------------------------------------------------------------------FL400      287nm   3157      2799     		1729                  2410                  6:42       		7:34FL300      249nm   2739      2381     		1269                  1856                  5:29       		6:13FL200      204nm   2244      1770              809                  1172                  3:52       		4:2310000      144nm   1584      1045              334           		486                  2:04       		2:185000   	100nm   1100   	588              156           		198                  1:06       		1:102500        68nm    748   	310       		51                    78           		:33                :341250        41nm    451   	105       		26                    36           		:15                :17 --------------------------------------------------------------------------------------------------------------------- <!-- VARIABLE DESCRIPTIONS -->GVAR1 = COM REGISTER FOR RESETGVAR2 = # OF IDENTS MATCHED, COUNTINGGVAR3 = # OF IDENTS MATCHED, STOREDGVAR4 = DB TIME COUNTER, RUNNINGGVAR5 = DB TIME, STOREDS1 L1 = TEMP REGISTERL:IDENT# (@myident(#)) = STATION IDENT STRING (1-5), MACRO IS READ/WRITEL:TYPE#  (@mytype(#)) = STATION TYPE STRING (1-5), MACRO IS READ/WRITEL:INX  = INDEX OF PREVIOUS NEAREST ARPT FOR DUPLICATE TYPE MATCH ROUTINEL:LAT# (@lat(#)) = LATITUDE OF FOUND AIRPORT (1-5), MACRO IS READ/WRITEL:LON# (@lon(#)) = LONGITUDE OF FOUND AIRPORT (1-5), MACRO IS READ/WRITEL:AP# (@ap(#)) = RAW BEARING FOR AP DIRECT HEADING SET (1-5), MACRO IS READ/WRITEL:COMMSELECT = SELECT COMM TO SLAVE TOS2 L10 - S3 L10 EVEN = AIRPORT IDENT REGISTERSS3 L3 - S11 L11 ODD = STATION TYPE REGISTERSS12 L12 - S20 L20 EVEN = STATION DISTANCE REGISTERSS13 L13 - S21 L21 ODD = STATION BEARING REGISTERS 

AND A PANEL.CFG SECTION I USED FOR MOONEY BRAVO.

 [Window01]BACKGROUND_COLOR=2,2,2size_mm=156,400  //156,370  orig 156,308position=8visible=1ident=RADIO_STACK_PANEL gauge00=Bendix_King_Radio!Bendix-King Radio Audio, 0, 0gauge01=Bendix_King_Radio!Bendix-King Radio Nav-Comm 1, 0, 29gauge02=Bendix_King_Radio!Bendix-King Radio Nav-Comm 2, 0, 86gauge03=Bendix_King_Radio!Bendix-King Radio DME, 0, 142gauge04=Bendix_King_Radio!Bendix-King Radio Xpndr, 0, 179gauge05=Bendix_King_Radio!Bendix-King Radio AP, 0, 224gauge06=COMM PROJECT!COMM5,3,269

Share this post


Link to post
Share on other sites

Hi Roman, Hmmm. This looks great. It will take me some time to work through it, but it looks like there are some pretty interesting things in here. One question right away ... Can you explain what's going on with some of your L:Var use such as L:ap@1, number I have frequently had the need to create L variables in the form of L:Var(n) where n is determined as the code runs sort of dynamically creating L var names... if you understand what I mean... THANKS for this!! Bob

Share this post


Link to post
Share on other sites

Bob, That is kind of what I am doing, while not doing it dynamically. It is more of a case of "ease of reading". In this gauge writing/reading an L:Var depending on when it is called. - L:ap@1, number could result in (L:ap1, number), (L:ap2, number), (L:ap3, number), (L:ap4, number) or (L:ap5, number) being read or written. Also if you notice in the macro <Macro Name="ap">L:ap@1, number</Macro> there are no parentheses surrounding the variable. Doing it this way you are able to read or write to that variable during a macro call. Ex. Read - (@ap(4)) will read (L:ap4, number)Write - l21 (>@ap(5)) Register 21 is being written to (L:ap5, number) IIRC from testing, you cannot use a variable for a macro call index, but you can use the value contained in the variable. Ex. @d2s((L:Type4, number)) works but @d2s(@mytype(4)) or (Not in code) @mytype(l1) does not, I could be wrong in the last example though,, It's been a long time LOL! Going to give that one a try, it's a dreary day out :-( Will edit results here. Why in the world I named @ap, L:ap@1, number to hold the bearing value I have no idea LOL! Roman EDIT... The following didn't work for me.. :-( Bummer, cause if it did.....Oh Boy :-)

<Macro Name="Test">L:Test@1, number</Macro>  <Update>1 s14 (>@Test(l1))l1 ++ s13 (>@Test(l1))l1 ++ s12 (>@Test(l1))l1 ++ s11 (>@Test(l1))</Update> <String>%TEST1 - %((L:Test1, number))%!d!%   TEST2 - %((L:Test2, number))%!d!%   TEST3 - %((L:Test3, number))%!d!%   TEST4 - %((L:Test4, number))%!d!%</String> <!-- Nor does replacing the <Update> with this -->  <Update>1 (>L:X, number)101 (>@Test(L:X, number))(L:X, number) ++ (>L:X, number)102 (>@Test(L:X, number))(L:X, number) ++ (>L:X, number)103 (>@Test(L:X, number))(L:X, number) ++ (>L:X, number)104 (>@Test(L:X, number))(L:X, number) ++ (>L:X, number)</Update>

Share this post


Link to post
Share on other sites

Roman, In the For What Its Worth section - there is a "trick" way that I can think of to store a (one) string. While it is not the intended use and could trip someone up if they are working with gps NameSearch elsewhere in their gauge, this will work: 'ABCDEFG' (>C:fs9gps:NameSearchInitialName) (C:fs9gps:NameSearchInitialName) is a string and it is Read & Write capable, so it can be written and stored (not wiped clean like the internal registers each Update cycle) for further use. It can save a lot of unsightly chr scat lines of code. The NameSearch character commands (NameSearchEnterChar, NameSearchAdvanceCursor, NameSearchAdvanceCharacter etc.) cannot be used to facilitate entering NameSearchInitialName since they only work on NameSearchCurrrentName. Bob

Share this post


Link to post
Share on other sites

I have prototyped an FSX module that will store and retrieve strings for XML gauges, using the same methodology that the GPS module does. A gauge would be a better solution, but so far that has proved elusive. Doug

Share this post


Link to post
Share on other sites

My son, Robbie (BlackBox author), has written a module that allows files to be written and read (files saved to and read from disk) from xml. FS9 and FSX. It handles numbers and strings, .txt and .csv formats, and when writing files, can start at the first record, or append records onto the end of the file. Very simple syntax. It’s simple, slick, and easy to use. It’s how I recorded the flight path and altitude shown in the Google Earth view on page 157 of the GPS Guidebook (v1.1) http://www.robbiemcelrath.com/blackbox/?guide. I also use it to save and load custom flight plans and SIDS/STARS and init info like Hobbs hours. Currently, he is updating BlackBox to incorporate the file recorder dll option. BB is an even more powerful diagnostic tool with file recording capability – and it is very interesting to plot various A:Var engine or flight variables vs. time, or L:vars... whatever. You can get a ton of information if the update rate is 18 cps and you write to file every update cycle **. He will release the xml file read/write module at the same time as he releases the BlackBox3 file recorder update. Anyway, what I was getting at in the post above is storing strings in memory rather than to disk. Doug - is your module a write to file or a write to memory solution? Bob ** Writing to file consumes a minor amount of time, and the module is synchronous with the gauge, so it is possible to reach the update cycle time out limit if too many variables are being written each update cycle. Having said that, in the gauge I use for testing, I can write about 740 separate variables to hard disk file every update cycle without running out of time. Even in a complex gauge, it can still write several hundred variables to file every update cycle. It can read several thousand records from file each update cycle without running out of time. So, I don’t think there really is a practical limit to its read/write capability.

Share this post


Link to post
Share on other sites

Bob, Bringing back this thread has got me back up and running :-) Anyhow from some past posts here & fs designer along with some VB.net coding ideas the brain has been reeling. Been working on a set of "hopefully" easy to use macros to store strings up to 6 digits ( good enough for FMC & other functions ) at a time. After hours of testing 6 digits is the max a L:Var can hold reliably. ( 32 bits ) Yours & Robbie's work is great! Cannot wait for what's in store. Ditto to Doug, a XML string --> Memory module sounds like a treat! Roman

Share this post


Link to post
Share on other sites
After hours of testing 6 digits is the max a L:Var can hold reliably. ( 32 bits )
Roman, Yeah, that is what I found, too!! So, two L:Vars can hold an ICAO. Perfect for an FMS. Sounds like your macros create the two L:Vars and also convert them back to strings. Good stuff. I always like to study your xml code. You are far more advanced than me, so I learn a lot from you. I wonder, if the coding is done very carefully, how often can you get away with storing strings in the internal registers? Probably before long, I am sure, one runs into the problem that you will need to remember strings for more than one update cycle which is why if Doug has a string --> memory module, that is extremely useful. Like having S:Vars (String vars)! Bob

Share this post


Link to post
Share on other sites

Seems we're not allowed to post attachments other than images. So...If you want to give this module a try, drop me a PM with your e-mail address and I'll ship it off to you. Doug

Share this post


Link to post
Share on other sites

Doug, So the fsx_string_storage.dll in the Modules folder? The following code in one of my xml gauges? <Launch.Addon> <Name>FSX_STRINGS</Name> <Disabled>False</Disabled> <Path>fsx_string_storage.dll</Path></Launch.Addon>(A:ATC TYPE, string) (>C:FSX_STRINGS:String00)<String>%((C:FSX_STRINGS:String00))%!s!</String> Jan

Share this post


Link to post
Share on other sites
Doug, So the fsx_string_storage.dll in the Modules folder? The following code in one of my xml gauges? <Launch.Addon><Name>FSX_STRINGS</Name><Disabled>False</Disabled><Path>fsx_string_storage.dll</Path></Launch.Addon> (A:ATC TYPE, string) (>C:FSX_STRINGS:String00)<String>%((C:FSX_STRINGS:String00))%!s!</String> Jan
Jan,The Launch.Addon section is just for FSX, to get the module to load. You won't need it for FS9.Yes, the .dll will need to go in the modules folder. Doug

Share this post


Link to post
Share on other sites

update on my ill-advised NameSearchInitialName idea. It's not such a good idea as it is hard to clear the variable. Doug's module, Roman's macros, or internal registers instead.........

Share this post


Link to post
Share on other sites

This is shaping up to be something of a game-changing thread in the XML world, IMHO. Doug's string --> memory module. Sweet. Wow. Extremely useful and it makes one wonder why MSFT didn't include such capability from the beginning, or at least from the time they added the gps module. I can't wait to try it out! Ditto Robbie's xml --> hard disk read/write module. There's a lot you can do when you are able to write to and read from file. I am having a lot of fun creating, saving and loading Flight Plans from within xml. Robbie will be releasing it soon - he is still polishing it and it will be my job to write the documentation. Bob

Share this post


Link to post
Share on other sites

Hi, with this code in an xml.gauge

 <!--<Launch.Addon><Name>FSX_STRINGS</Name><Disabled>False</Disabled><Path>fsx_string_storage.dll</Path></Launch.Addon>--><Element><Select><Value>(A:ATC FLIGHT NUMBER,string) (>C:FSX_STRINGS:String00)</Value></Select></Element> <Element><Position X="0" Y="200"/><FormattedText X="200" Y="450" FontSize="40" Font="Arial" Color="RED" Adjust="CENTER" VerticalAdjust="Center"><String>%((C:FSX_STRINGS:String00))%!s!</String></FormattedText></Element> 

i only get "0." Jan

Share this post


Link to post
Share on other sites
<Value>(A:ATC FLIGHT NUMBER,string) (>C:FSX_STRINGS:String00)</Value>
Hi, I haven't tried it yet, but should (A:ATC FLIGHT NUMBER,string) (>C:FSX_STRINGS:String00) just be a line of code in your Update section rather than inside a <Value> tag? And for FS9, Doug's dll module is copied to the modules folder and there should be no need for the <Launch.Addon> section......... I think / guess Hope this works. I am anxious to make use of it too. Bob

Share this post


Link to post
Share on other sites
Hi, with this code in an xml.gauge
 <!--<Launch.Addon><Name>FSX_STRINGS</Name><Disabled>False</Disabled><Path>fsx_string_storage.dll</Path></Launch.Addon>--><Element><Select><Value>(A:ATC FLIGHT NUMBER,string) (>C:FSX_STRINGS:String00)</Value></Select></Element> <Element><Position X="0" Y="200"/><FormattedText X="200" Y="450" FontSize="40" Font="Arial" Color="RED" Adjust="CENTER" VerticalAdjust="Center"><String>%((C:FSX_STRINGS:String00))%!s!</String></FormattedText></Element> 

i only get "0." Jan

Jan, It may not work in FS9. I haven't tried it myself. I don't have a reliable FS9 install any more, and the install disks are buried away in a box somewhere... Doug

Share this post


Link to post
Share on other sites

Thank-You!! Doug, PM sent.. To keep going on this topic, For XML only... ( tested in FS9) Spent most of the US labor day on this little brain teaser, just a theory I needed to prove before I lost it! ( Both mind and idea LOL! ) But I think I have found a nice set of Macros that will save 6 or less (automatic) char digits into 1 L:Var. They are very easy to use and flexible. Buy using multiple properly formatted Macro calls one could save "words" up to an unlimited amount of Chars. Kept going on this and made a FMC that does absolutely nothing (LOL!) except demonstrate some of the coding. ( Attached Code ) The "test" FMC works like any other. To turn on keyboard ( Turns green ) for input, left click on "keyboard" button. To clear scratchpad, right click on "keyboard" button. A "Reload Panels" button is provided on the lower right hand screw. For example purposes the FMC is coded to provide up to 18 chars per LSK. Just a note, if one would have made this using one L:Var per Char it would've taken 90 of them, in this it took only 15. The Macros use the upper registers ( 46 - 49 ) to stay "out of the way" and the display uses ( 1 - 9 ). If one was to uses similar coding like this in a true FMC with 6 LSKs on each side and the scratchpad one would have approx 33 left over to do other things. IE each page of FMC only uses 1-13, the strings are processed only when needed/displayed, it makes the display string much easier to deal with and saves processor/FPS. Syntax for the Macro "SaveString" ( 'Raw string', GPS string or l register ) @SaveString(n) ( L:Var to save to )Where (n) in the macro call is the section of 6 or less chars to be saved. Ex.'ABCDEFGHIJKL' @SaveString(1) = 706968.676665 = FED.CBA --> (L:Var#1)'ABCDEFGHIJKL' @SaveString(2) = 767574.737271 = LKJ.IHG --> (L:Var#2)Note - As you notice, the resulting output is reversed. This is done so when a null char is found, 00 replaces it and the value remains valid. EX. .000065 works but 65.0 would not if 'A' was the only char sent to the macro. I may have done this a different way using a downward counting pow, (650000.0 and a lot more code) but this works. To reduce overhead the macro stops processing once the string length is reached. Syntax for the Macro "RebuildString" ( L:Var, G:Var or Raw number ) @RebuildString ( Output, or Register to continue ) Ex. based on the above SaveString(L:Var#1) @RebuildString = 'ABCDEF' if only a 6 char word is used. For more than 6 then, (L:Var#2) @RebuildString = 'GHIJKL' sp1(L:Var#1) @RebuildString = 'ABCDEF' l1 (=GHIJKGL) scat s1 (=ABCDEFGHIJKL)Note - As you notice, when more than 1 6 digit word is processed it is done reversed. This is done because if it was done in a forward fashion 2 registers would have been needed. :-( The macro processes 2 digits at a time ( 2 are needed for a full char ) and stops processing when a value is less than 30, again for overhead savings. I know that 32 = (space)bar and that the lowest char (!) in charmap.exe = 0x21 = decimal 33. What #s 31 and 30 are, I have no idea, just left a little cushion is all. Notes for both - As you can see 2 and ONLY 2 digits per char can be used in these macros (decimal 30 - 99), this means NO special chars. If you follow the ASCII map up to small 'a' it will work. If one uses the ASCII input via <Keys> in FS, no problems will occour. Maybe someone can use this example,Just something to add to this topic. Roman The "useless" FMC :-)

<Gauge Name="STRING_STORE_TEST" Version="1.0"> <Element Name="BACKGROUND"><Rectangle Width="200" Height="175" FillColor="#b7b7b7" LineWidth="4" Color="#7f7f7f" Bright="Yes"/></Element><Element><Position X="0" Y="0"/><Circle Radius="4" FillColor="Black" Bright="Yes"/></Element><Element><Position X="193" Y="0"/><Circle Radius="4" FillColor="Black" Bright="Yes"/></Element><Element><Position X="0" Y="167"/><Circle Radius="4" FillColor="Black" Bright="Yes"/></Element><Element><Position X="193" Y="167"/><Circle Radius="4" FillColor="Black" Bright="Yes"/></Element><Element><Position X="34" Y="12"/><Rectangle Width="160" Height="140" FillColor="#010101" Bright="Yes"/></Element><Element><Position X="7" Y="20"/><Rectangle Width="20" Height="10" FillColor="#010101" LineWidth="2" Color="#7f7f7f" Bright="Yes"/></Element><Element><Position X="7" Y="50"/><Rectangle Width="20" Height="10" FillColor="#010101" LineWidth="2" Color="#7f7f7f" Bright="Yes"/></Element><Element><Position X="7" Y="80"/><Rectangle Width="20" Height="10" FillColor="#010101" LineWidth="2" Color="#7f7f7f" Bright="Yes"/></Element><Element><Position X="7" Y="110"/><Rectangle Width="20" Height="10" FillColor="#010101" LineWidth="2" Color="#7f7f7f" Bright="Yes"/></Element><Element><Position X="70" Y="155"/><Rectangle Width="85" Height="15" FillColor="#010101" LineWidth="2" Color="#7f7f7f" Bright="Yes"/></Element> <!-- ############################################################################### --> <!-- REGISTERS FOR SAVING STRING47 = The string to be converted48 = String Length49 = Temporary & Final To Save--> <Macro Name="SaveString">@1 1 - 6 * 6 ssub sp470 sp49l47 slen sp48:2112l47 l48 symb ord 1 + 0.000001 * l49 100 * + 0.000001 - s49l48 0 > if{ l48 -- sp48 g2112 }</Macro>  <!-- REGISTERS FOR REBUILDING STRING46 = Raw Value, Part 1 of 2 separated (reversed)47 = Raw Value, Part 2 of 2 separated (reversed)48 = Temp Value49 = Output--> <Macro Name="RebuildString">d int d sp47 r - 1000000 * int abs sp46'' sp49:2112l46 10 % sp48 l46 0.1 * int 10 % 10 * l48 + s48l49 l48 chr scat s49 l46 0.01 * int d s46 30 > if{ g2112 } els{ l47 s46 30 > if{ 0 sp47 g2112 } } l49</Macro> <!--STORAGE VARIABLES--><Macro Name="LSK1">L:Test_Store_1_@1, number</Macro><Macro Name="LSK2">L:Test_Store_2_@1, number</Macro><Macro Name="LSK3">L:Test_Store_3_@1, number</Macro><Macro Name="LSK4">L:Test_Store_4_@1, number</Macro><Macro Name="SCRATCHPAD">L:Test_Store_5_@1, number</Macro><Macro Name="KYBRD">L:Test_Store_6_@1, number</Macro> <Macro Name="CLEAR_SCRATCHPAD">0 (>@SCRATCHPAD(1)) 0 (>@SCRATCHPAD(2)) 0 (>@SCRATCHPAD(3))</Macro>  <!-- ############################################################################### --> <Update> <!-- As an example, when the gauge is first loaded some arbitrary strings are saved, just for kicks. -->(G:var1) 0 == if{ 1 (>G:Var1) 'ABCDEFGHIJKLMNOPQR' s1@SaveString(1) (>@LSK1(1))l1 @SaveString(2) (>@LSK1(2))l1 @SaveString(3) (>@LSK1(3)) '0123456789ZYXWVUTS' s2@SaveString(1) (>@LSK2(1))l2 @SaveString(2) (>@LSK2(2))l2 @SaveString(3) (>@LSK2(3)) 'THIS IS A TEST!' s3@SaveString(1) (>@LSK3(1))l3 @SaveString(2) (>@LSK3(2))l3 @SaveString(3) (>@LSK3(3)) 'I HOPE IT WORKS :)' s4@SaveString(1) (>@LSK4(1))l4 @SaveString(2) (>@LSK4(2))l4 @SaveString(3) (>@LSK4(3)) } <!-- Rebuild LSK1 -->(@LSK1(3)) @RebuildString sp1(@LSK1(2)) @RebuildString l1 scat s1(@LSK1(1)) @RebuildString l1 scat s1 <!-- Rebuild LSK2 -->(@LSK2(3)) @RebuildString sp2(@LSK2(2)) @RebuildString l2 scat s2(@LSK2(1)) @RebuildString l2 scat s2 <!-- Rebuild LSK3 -->(@LSK3(3)) @RebuildString sp3(@LSK3(2)) @RebuildString l3 scat s3(@LSK3(1)) @RebuildString l3 scat s3 <!-- Rebuild LSK4 -->(@LSK4(3)) @RebuildString sp4(@LSK4(2)) @RebuildString l4 scat s4(@LSK4(1)) @RebuildString l4 scat s4 <!-- Rebuild Line SCRATCHPAD -->(@SCRATCHPAD(3)) @RebuildString sp5(@SCRATCHPAD(2)) @RebuildString l5 scat s5(@SCRATCHPAD(1)) @RebuildString l5 scat s5 <!-- Add digits to line SCRATCHPAD from keyboard-->(L:CHR_DIGIT, number) 0 > if{(L:CHR_DIGIT, number) chr scat s5@SaveString(1) (>@SCRATCHPAD(1))l5 @SaveString(2) (>@SCRATCHPAD(2))l5 @SaveString(3) (>@SCRATCHPAD(3))0 (>L:CHR_DIGIT, number) } <!-- EX. The word "KEYBOARD" is stored into 2 L:vars then put back together to be displayed via L6 -->'KEYBOARD' @SaveString(1) (>@KYBRD(1))'KEYBOARD' @SaveString(2) (>@KYBRD(2)) (@KYBRD(2)) @RebuildString sp6(@KYBRD(1)) @RebuildString l6 scat s6 </Update> <!-- ############################################################################### --> <Element Name="DISPLAY"><Position X="42" Y="19"/><FormattedText X="150" Y="133" Font="Arial" FontSize="11" VerticalAdjust="Center" Color="Yellow" Bright="Yes" LineSpacing="15"><String>%\{tabs=2L}%(l1)%!s!%\n%\n%\{tabs=2L}%(l2)%!s!%\n%\n%\{tabs=2L}%(l3)%!s!%\n%\n%\{tabs=2L}%(l4)%!s!%\n%\n%\{tabs=2L}%(l5)%!s!%\n%\n</String></FormattedText></Element> <Element Name="KEYBOARD TEXT VIA L and L6 STORAGE"><Position X="70" Y="155"/><Text X="83" Y="18" Bright="Yes" Length="100" Color="%('Green' 'Red' (L:Keyboard_Active, bool) ?)" Font="Arial" FontSize="14" Adjust="Center" VerticalAdjust="Center" FontWeight="800"><String>%(l6)%!s!%</String></Text></Element> <!-- ############################################################################### --> <Mouse> <Area Name="LSK1" Left="7" Top="20" Width="20" Height="10"><Cursor Type="Hand"/><Click>(@SCRATCHPAD(1)) 0 > if{ (@SCRATCHPAD(1)) (>@LSK1(1)) (@SCRATCHPAD(2)) (>@LSK1(2)) (@SCRATCHPAD(3)) (>@LSK1(3)) @CLEAR_SCRATCHPAD } els{ (@LSK1(1)) (>@SCRATCHPAD(1)) (@LSK1(2)) (>@SCRATCHPAD(2)) (@LSK1(3)) (>@SCRATCHPAD(3)) 0 (>@LSK1(1)) 0 (>@LSK1(2)) 0 (>@LSK1(3)) }</Click></Area> <Area Name="LSK2" Left="7" Top="50" Width="20" Height="10"><Cursor Type="Hand"/><Click>(@SCRATCHPAD(1)) 0 > if{ (@SCRATCHPAD(1)) (>@LSK2(1)) (@SCRATCHPAD(2)) (>@LSK2(2)) (@SCRATCHPAD(3)) (>@LSK2(3)) @CLEAR_SCRATCHPAD } els{ (@LSK2(1)) (>@SCRATCHPAD(1)) (@LSK2(2)) (>@SCRATCHPAD(2)) (@LSK2(3)) (>@SCRATCHPAD(3)) 0 (>@LSK2(1)) 0 (>@LSK2(2)) 0 (>@LSK2(3)) }</Click></Area> <Area Name="LSK3" Left="7" Top="80" Width="20" Height="10"><Cursor Type="Hand"/><Click>(@SCRATCHPAD(1)) 0 > if{ (@SCRATCHPAD(1)) (>@LSK3(1)) (@SCRATCHPAD(2)) (>@LSK3(2)) (@SCRATCHPAD(3)) (>@LSK3(3)) @CLEAR_SCRATCHPAD } els{ (@LSK3(1)) (>@SCRATCHPAD(1)) (@LSK3(2)) (>@SCRATCHPAD(2)) (@LSK3(3)) (>@SCRATCHPAD(3)) 0 (>@LSK3(1)) 0 (>@LSK3(2)) 0 (>@LSK3(3)) }</Click></Area> <Area Name="LSK4" Left="7" Top="110" Width="20" Height="10"><Cursor Type="Hand"/><Click>(@SCRATCHPAD(1)) 0 > if{ (@SCRATCHPAD(1)) (>@LSK4(1)) (@SCRATCHPAD(2)) (>@LSK4(2)) (@SCRATCHPAD(3)) (>@LSK4(3)) @CLEAR_SCRATCHPAD } els{ (@LSK4(1)) (>@SCRATCHPAD(1)) (@LSK4(2)) (>@SCRATCHPAD(2)) (@LSK4(3)) (>@SCRATCHPAD(3)) 0 (>@LSK4(1)) 0 (>@LSK4(2)) 0 (>@LSK4(3)) }</Click></Area> <Area Name="KEYBOARD" Left="70" Top="155" Width="85" Height="15"><Cursor Type="Hand"/><Click Kind="LeftSingle+RightSingle">(M:Event) 'LeftSingle' scmp 0 == if{ (L:Keyboard_Active, bool) ! (>L:Keyboard_Active, bool) } els{ @CLEAR_SCRATCHPAD }</Click></Area> <Area Name="RELOAD" Left="187" Top="163" Width="11" Height="11"><Cursor Type="Hand"/><Click>(>K:RELOAD_PANELS)</Click></Area> </Mouse> <!-- ############################################################################### --> <Keys><On Key="Ascii"><Visible>(L:Keyboard_Active, bool)</Visible>(M:Key) (>L:CHR_DIGIT, number)</On></Keys>  </Gauge> [/Code]

The panel window entry used when String_Test.xml is placed into a folder named the same.

[Code][WindowXX]Background_color=1,1,1size_mm=400,350position=1visible=1ident=10001 gauge00=String_Test!String_Test, 4,4,400,350[/Code]

EDIT - CHANGES WHERE MADE TO THE @RebuildString MACRO DESCRIPTION.. THERE ARE ( as of now ) NO VALUES TO BE SENT ON A @RebuildString CALL.. oops.

Share this post


Link to post
Share on other sites

With Doug, Bob, & Robbie & maybe me, throwing in ideas, projects, modules etc.. into the foray. I do believe a whole new era has arrived w/ XML.. More to come, guaranteed. I am the Walrus. LOL! Roman

Share this post


Link to post
Share on other sites

Roman, Something to digest....!Of course it works, but only to save strings like the Keyboard and GVar section examples? Jan

Share this post


Link to post
Share on other sites

Roman, I like your macros and I always learn a lot from you. I see that you are working with the ascii decimal code – what you get from an M:Key or ord. Then you use numerical operators, multiplication and addition to construct an LVar moving the ord value to the right place when each new character is processed. Alternatively, have you considered working with the ascii binary instead of decimal? If you do that, then you could use the bit operators to shift the values (ie, 5 >> or 7 <<) with each new character processed. Wouldn’t a bit shift approach greatly simplify the code needed to construct the LVar? I am trying that way now – as always, at the suggestion and guidance of Robbie, but I am pretty much stuck at the moment because my xml capability isn’t quite up to the challenge. You, on the other hand, would be able to make it work I’m sure. And I agree with you. I think this thread is a pretty interesting glimpse into the future of xml capability. Bob

Share this post


Link to post
Share on other sites

×
×
  • Create New...