You are correct in that a variable must exist prior to its use with F_WRITE.

I usually declare or initialize all my variables at the beginning of the
macro.

STRING:#StrVar
INTEGER:#IntVar
#DecVar=0


Assigning a variable to the number 1000000 will remove the variable similar
to the VAR_REMOVE command.

Why do find it necessary to clear the variable? If it is just to force the
prompting for a value you may want to try the PROMPT command or use the CTK.

Would it be possible to post an example of your macro F_WRITE code?

=============================================
 Fred Lauzus, CAM Programming Coordinator
 High Steel Structures, Incorporated
 mailto:[EMAIL PROTECTED] http://www.highsteel.com
=============================================
 



-----Original Message-----
From: Pete Ruehle [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 23, 2002 4:05 PM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [mfg-smartcam] declaring variables


Fred,

Thanks for the info.  I'm having two problems (macros).  The first has to do
with decimal variables.  If I establish the variable and a value first, as
with a ctk dialog or panel and then launch the macro, the variable is
decimal.  However, if I launch the macro and enter a value at the prompt
when the variable is first encountered, it sometimes ends up being a string
type.

The second problem is that F_WRITE does not recognize the variable unless I
establish it at the beginning or before the macro is launched.  It will not
recognize it if I run the macro and enter a value when prompted.  So how do
I get around this without using ctk?  Do I have to open the mcl and enter
all the variable values at the start of the macro?  I tried #decvar=0 but
then I had to clear it immediately afterwards with #decvar=1000000.  I was
then prompted for the value during macro execution but as before, F_WRITE
didn't pick it up.
  

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 23, 2002 2:02 PM
To: [EMAIL PROTECTED]
Subject: RE: [mfg-smartcam] declaring variables


In a template file it's

@DECLARE
#DEC #DecVar
#STR #StrVar
#INT #IntVar

In a macro file decimal is the default declaration with string and inter
variables having unique declarations.

STRING:#StrVar
INTEGER:#IntVar

If you need to establish a decimal variable beforehand, such as with the
F_READ and F_WRITE commands, try this:

#DecVar=0

That will create a decimal variable as long as the name is previously unused
otherwise.

On some occasions I've had to clear specific variables and re-declare them
to insure they are the proper type.

VAR_REMOVE[VN="DecVar"]
#DecVar=0



-----Original Message-----
From: Pete Ruehle [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 23, 2002 1:45 PM
To: 'SmartCam Forum'
Subject: [mfg-smartcam] declaring variables


What is the format for declaring a decimal variable?
======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [EMAIL PROTECTED]
======================================================================
======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [EMAIL PROTECTED]
======================================================================
======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [EMAIL PROTECTED]
======================================================================

Reply via email to