PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: John Montenigro on October 18, 2006, 08:38:43 PM

Title: need manual MICROTEMP declarations?
Post by: John Montenigro on October 18, 2006, 08:38:43 PM
My app has a MACRO that begins:


MACRO FUNCTION ScanUDTbyNumericMember(arrayname,memberID,target)
   MacroTemp q, hit
   hit = -1
...
END MACRO = hit



It compiled and ran just fine in PBWIN, but in FF, I kept getting Error 519, Missing Declaration: HIT0001.

So I added:
LOCAL hit0001 As Long

Then it gave me the same error for : Q0001


It wouldn't compile in FF until I explicitly added:

LOCAL hit0001 As Long, q0001 As Long

With them declared, it compiled and ran OK...


What does FF not like about the MICROTEMP declarations??
Title: need manual MICROTEMP declarations?
Post by: TechSupport on October 18, 2006, 10:48:12 PM
Good question. Possible that the FireFly parser is picking up the "Macro" part of the "MarcoTemp" and thinking that it is part of a new Marco. Obviously, FireFly should be looking for "Macro " <--- note the space. I will check the parser tomorrow to see if that is indeed the case.
Title: need manual MICROTEMP declarations?
Post by: John Montenigro on October 19, 2006, 01:50:48 AM
Quote from: TechSupportGood question. Possible that the FireFly parser is picking up the "Macro" part of the "MarcoTemp" and thinking that it is part of a new Marco. Obviously, FireFly should be looking for "Macro " <--- note the space. I will check the parser tomorrow to see if that is indeed the case.

Prior to the macro in question, I have two other macros, and each has a MACROTEMP line that has compiled without problem...


I've tried changing "macrotemp" to "macro temp" but no good - FF reports a missing END MACRO...

Interestingly, I commented out the macrotemp line, and declared
LOCAL hit, q
just before the location that the macro would be substituted.
I figured that the post-substitution code would use the variable from the mainline code. It worked. It just doesn't resolve the problem...
Title: need manual MICROTEMP declarations?
Post by: Sean Roe on October 19, 2006, 01:51:52 AM
From my understanding of Macros shouldn't your code be:

MACRO FUNCTION ScanUDTbyNumericMember(arrayname,memberID,target)
   MacroTemp q, hit
   Dim q&, hit& <----missing declaration  
   hit = -1
...
END MACRO = hit


Hope that helps.
Title: need manual MICROTEMP declarations?
Post by: John Montenigro on October 19, 2006, 01:56:02 AM
Quote from: Sean RoeFrom my understanding of Macros shouldn't your code be:

MACRO FUNCTION ScanUDTbyNumericMember(arrayname,memberID,target)
   MacroTemp q, hit
   Dim q&, hit& <----missing declaration  
   hit = -1
...
END MACRO = hit


Hope that helps.



Thanks for the thought, but that gives Error 474, Invalid Name: hit&

Our two prior messages cross-posted. I have other macros that use macrotemp and are OK...
Title: need manual MICROTEMP declarations?
Post by: John Montenigro on October 19, 2006, 02:01:50 AM
Quote from: Sean RoeFrom my understanding of Macros shouldn't your code be:

MACRO FUNCTION ScanUDTbyNumericMember(arrayname,memberID,target)
   MacroTemp q, hit
   Dim q&, hit& <----missing declaration  
   hit = -1
...
END MACRO = hit


Hope that helps.


I initially mis-read your post! I thought you were indicating to just add the identifier. I didn't see the DIM line...

Yes, you're right - I added the declaration line and it's OK.

I forgot to add it into the macro definition because I had already declared those variables as LOCAL in the code just before the point the substitution would occur...

I didn't realize the parsers/compilers cared where the variables were declared, as long as (after the text substitution), it was all accounted for...

Thanks!!!
-John
Title: need manual MICROTEMP declarations?
Post by: Sean Roe on October 19, 2006, 02:16:12 AM
You're welcome and thanks for the response.