[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2007-08-02
5
Medium Priority
?
1,057 Views
Last Modified: 2008-03-25
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

0
Comment
Question by:XYZCode
  • 2
4 Comments
 
LVL 6

Expert Comment

by:Ioannis Anifantakis
ID: 19623934
why not use sets like

cdtitlestrings= ['CD_MED', 'CD_DENTAL', 'CD_PHARM'];
0
 

Author Comment

by:XYZCode
ID: 19625903
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
 

Author Comment

by:XYZCode
ID: 19769242
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
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 21207204
PAQed with points refunded (250)

Computer101
EE Admin
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question