Compile

belao

New Member
Hi All

How to compile this code to r.code:

/****************************/
def shared temp-table tt-x
field c as char
field i as int.


For each {1}
where {1}.{2} <> "root".

assign i = i + 1.

create tt-x.
assign tt-x.a = lc{1}.{2}
tt-x.i = i.

end.

/*********end code***********/

Or is not possible?
 
This can not be compiled, it is written as an include file and must be reference in another procedure that supply the argument-values for {1}, {2} and {3}.



belao said:
Hi All

How to compile this code to r.code:

/****************************/
def shared temp-table tt-x
field c as char
field i as int.


For each {1}
where {1}.{2} <> "root".

assign i = i + 1.

create tt-x.
assign tt-x.a = lc{1}.{2}
tt-x.i = i.

end.

/*********end code***********/

Or is not possible?
 
Hi, if you 're progress version is at least 9.nn then you can use this code:

DEF VAR hqry AS WIDGET-HANDLE NO-UNDO.
DEF VAR hbuf AS WIDGET-HANDLE NO-UNDO.
DEF VAR hfld AS WIDGET-HANDLE NO-UNDO.

CREATE BUFFER hbuf FOR TABLE <TABLE NAME>.
hfld = hbuf:BUFFER-FIELD(<FIELD NAME>).
CREATE QUERY hqry.
hqry:SET-BUFFERS(hbuf).
hqry:QUERY-PREPARE("FOR EACH <TABLE NAME> WHERE <FIELD NAME> <> 'root'").
hqry:QUERY-OPEN().
hqry:GET-FIRST().
REPEAT WHILE NOT hqry:QUERY-OFF-END:
assign i = i + 1.
create tt-x.
assign
tt-x.a = LC(hfld:BUFFER-VALUE)
tt-x.i = i.
hqry:GET-NEXT().
end.
hqry:QUERY-CLOSE().
DELETE OBJECT hqry.
DELETE OBJECT hfld.
DELETE OBJECT hbuf.

hope it helps.

Stéphane.
 
cecsno said:
Are you saying you Progress environment is runtime and you need your source code encrypted to compile?


Yes, this exactly.
I use this code in a program:

Example: Run c:\temp\code.p LDBNAME(i) "_Filelist" "_Filelist-name".
 
belao said:
Yes, this exactly.
I use this code in a program:

Example: Run c:\temp\code.p LDBNAME(i) "_Filelist" "_Filelist-name".
So you do not have a develpment environment associated with the application in question. Does the application provide a mechanism to compile code? Can you find a file called xcode or xcode.exe, if so you use xcode to encript and start a compile session with the -rx parameter.

Even with this you will not be able to compile a procedure where _file-name and _field-name are undefined at compile time. To do this you will have to have Progess Dynamics and develop a procedure like StefGay posted.


Please when posting questions, try to provide Progress Version, O/S and if a commercial application it's name and version. Answers will come quicker.
 
Back
Top