Any ROPS (Rem Objects Pascal Script) GURUs here? I Need help!!!!!!!!!

ANY ROPS - (REM OBEJCTS PASCAL SCRIPT) GURUs OUT THERE?

I know how to register a "Type" in ROPS

Cl.AddTypeS('CD_TYPE', '(CD_MED, CD_DENTAL, CD_PHARM)');

how do I go about registering a constant array (Using my type above)?

cdtitlestrings: array[cd_med..cd_pharm] of string=('Medical','Dental','Pharmaceutical');

Do I use the AddConstantN call?

If so, how do I use it to register my constant array above.

Please, be explicit - I need to know how to register the exact constant array I describe above.

THanks

XYZCodeAsked:
Who is Participating?
 
Computer101Commented:
PAQed with points refunded (250)

Computer101
EE Admin
0
 
Ioannis AnifantakisSoftware EngineerCommented:
why not use sets like

cdtitlestrings= ['CD_MED', 'CD_DENTAL', 'CD_PHARM'];
0
 
XYZCodeAuthor Commented:
Thats not an option, besides, even if it was an option, you haven't showed any code on how to register a set like that in Pascal Script.

But again, its not an option...since pascal script is a scripting subset of code already written. I can't go back and change the code.  I need to register existing code ....and thats the Constant Array.

Thanks for trying though.
0
 
XYZCodeAuthor Commented:
Solved on my own.

Basically, you create a type

type
 
 TCDTitleStrings = array[1..3] of string;

Then create a variable of the type

var

 CDTitleStrings: TCDTitleStrings = ('Medical', 'Dental', 'Pharmaceutical');


Then register each

procedure SIRegister_ValuPay_Classes_TypesAndConsts(Cl: TPSPascalCompiler);
begin
 ...
 Cl.AddTypeS('TCDTitleStrings', 'array[1..3] of string').ExportName:= True;
end;


procedure TVPScript.DoCompile(Sender: TPSScript);
begin
 ...
 Sender.AddRegisteredPTRVariable('CDTitleStrings', 'TCDTitleStrings');
end;

procedure TVPScript.DoExecute(Sender: TPSScript);
begin
 ...
 fEngine.SetPointerToData('CDTitleStrings', @CDTitleStrings, Sender.FindNamedType('TCDTitleStrings'));
end;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.