I just need some clarity of the purpose of the PGNO.. like can I use that to call a program and not the program name? Using Directory loader; manual says I can change the old program number to a new program number, but why would you ever need to do that unless you can call it by the number?
Purpose of PGNO??
- TickTack
- Thread is marked as Resolved.
-
-
Getting to the point of this project I need to be able to cal a program via a variable , is this possible ??
-
if using EXT mode sure, why not...
use SPS to pass the string with program name (instead of PGNO), use CWRITE to select program, and external start to start it...
-
That's awesome, i knew there is always a way. Can you elaborate, using CWRITE I'm weak in this category.
Would it be something similar to this?
IF $IN[10]==TRUE THEN ;Start
CWRITE($CMD,STAT,MODE,"RUN /R1/variable") ; where i can set the program to a variable and define it in the .sps
ENDIFI don't think i know how to make the program into a variable that i an call.
I also need to turn the program number into a string so i can add to the string so the program names match.
-
You'll have to construct a string for the run command. This is easy enough to do using SWRITE.
DECL a string variable of sufficient length.
Clear the string variable.
SWRITE the string variable with something like SWRITE (StringVariable[], State, Offset, "RUN /R1/%s", ProgramNameString[])
CWRITE ($CMD, STAT, MODE, StringVariable[])You'll want to read up on the SWRITE function in detail, it's a bit involved. Very handy once you grasp it.