[futurebasic] Re: [FB] [FB3] passing.... uh.... vars

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1999 : Group Archive : Group : All Groups

From: "Al Boyd" <aboyd@...>
Date: Wed, 01 Dec 1999 05:25:24 -0800
> Al, can you be more specific? If you're right there is another important
> bug lurking. If you're wrong you just scaring us Big Time :-)

First let me state that I'm using the CD version of FB^3 (i'm not on the
beta list/team). I was doing a "trial" conversion of my app just to get a
feel of FB^3, so I would be familiar with it when version 1 is released.

In my hurricane tracking program, users can place locations on any of
McHurricane's maps by entering the location's name, latitude and longitude.
The locations are kept in a preference file. When I finally got my app
running in FB^3 the locations were not being plotted on the maps... that's
when I reported the original problem/bug. When Staz responded with the
fix... the locations still would not plot. Took a wild guess and moved the
strings behind the intergers (when passing parameters) and the locations
plotted correctly.

In the below example I'm passing 8 parameters. Originally when trying to
find a fix I reduced parametes to as few as 6, still with no luck on the bug
until I flip-flopped the intergers and strings. I then moved back to 8
parametes without any problems. I have pref set to use dimmedVarsOnly. This
is a edited/simplified version of how things work... names have been changed
to protect the innocent :-)

'=======================================
LOCAL FN plotLocOnMap(xPs%,yPs%,colr%,sze%,styl%,nam$,lat$,lon$)
'---------------------------------------
  [do the plot thing here]

END FN


'=======================================
LOCAL FN addLocsToMap
'---------------------------------------
 numOfElem% = gNmAltBasLocs% - 1
 FOR x% = 0 TO numOfElem%
   tNam$   = AtlBas.lName$(x%)
   tLat$   = AtlBas.lLat$(x%)
   tLon$   = AtlBas.lLon$(x%)
   xPos%   = AtlBas.textX%(x%)
   yPos%   = AtlBas.textY%(x%)
   tColor% = AtlBas.lColor%(x%)
   tSize%  = AtlBas.lTxSize%(x%)
   tStyle% = AtlBas.lStyle%(x%)
   mrkr%   = AtlBas.marker%(x%)

   gAD_mrkr% = mrkr% 'had to make this global because of the parameter limit

   FN plotLocOnMap(xPos%,yPos%,tColor%,tSize%,tStyle%,tNam$,tLat$,tLon$)

 NEXT
END FN

'--------------------------------------

The above example would not work when parameters were set like this....

FN plotLocOnMap(tNam$,tLat$,tLon$,xPos%,yPos%,tColor%,tSize%,tStyle%)

The variables would be holding this type of info...

tNam$   = "Victoria"
tLat$   = "28.8"
tLon$   = "97.0"
xPos%   = 2
yPos%   = -13
tColor% = _zRed              'or _zBlack or _zBlue (only)
tSize%  = 9                  'font pt size (9,10,12 only)
tStyle% = _boldBit%          'or _nil
gAD_mrkr% = _true or _false  'user can have locations without a marker

Note that the xPos% and yPos% are for where the location's name is to be
placed on the map in relation to the marker. The marker's pixel coordinates
are calculated based off the latitude and longitude.

HTH,
Al

=================================================
McHurricane: Macintosh Storm Tracking Software

http://members.aol.com/stormeye
email: aboyd@...
=================================================