Johntosh Posted January 7, 2009 Posted January 7, 2009 Is it possible to place an IF statement inside a COMMAND? I am compiling a block and I would like it to redefine the block when necessary. (command "_.BLOCK" "BLOCK_NAME" ** line hypothetical (if block exist then redefine = y) ** 0,0 sset "" ) Quote
lpseifert Posted January 7, 2009 Posted January 7, 2009 Put your if statement prior (if (tblsearch "block" "blockname") (then do this); if the block exists (else do this));if the block doesn't exist Quote
David Bethel Posted January 7, 2009 Posted January 7, 2009 Johntosh, For the scenario you are working with, check out the sysvar EXPERT. Setting it to 5 will bypass the redefine question. [b][color=BLACK]([/color][/b]setq oldexp [b][color=FUCHSIA]([/color][/b]getvar [color=#2f4f4f]"EXPERT"[/color][b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] [b][color=BLACK]([/color][/b]setvar [color=#2f4f4f]"EXPERT"[/color] 5[b][color=BLACK])[/color][/b] [color=#8b4513];;;DO YOUR THING HERE[/color] [b][color=BLACK]([/color][/b]setvar [color=#2f4f4f]"EXPERT"[/color] oldexp[b][color=BLACK])[/color][/b] It is possible to do it inside the ( command ), but I would not recommend it. -David Quote
Johntosh Posted January 7, 2009 Author Posted January 7, 2009 Thanks guys! That's a cute one, David. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.