The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Setting up a HVar inside a program, IF it doesn't already exist.
04-09-2022, 06:51 PM (This post was last modified: 04-09-2022 06:52 PM by matalog.)
Post: #1
Setting up a HVar inside a program, IF it doesn't already exist.
I am using the following code to set up a list Variable inside a program, that the program will use if it already exists, and will create a list, if it doesn't already exist.

Code:

prep2number:=size(HVars);
prep2:=HVars;
   IF prep2number>0 THEN
    FOR Z FROM 1 TO prep2number DO
     IF prep2(Z)="CL" THEN prep2check:=1;END;
    END;
   END;

   IF prep2check=0 THEN
    HVars("CL"):={"1","2"};
     FOR Z FROM 1 TO 30 DO
      CL(Z):=string(Z);
     END;
   END;

This leaves a syntax error on the line CL(Z):=string(Z);.

If I use HVars("CL"):={"1","2"} on the Home screen, it sets up the variable fine.

Is there a way to do what I want to do, as it seems this is not the way?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Setting up a HVar inside a program, IF it doesn't already exist. - matalog - 04-09-2022 06:51 PM



User(s) browsing this thread: 3 Guest(s)