Página 6 de 7
Recompiling Old Summer87 Program
Enviado: 16 Mai 2012 16:40
por marge0512
I have a feeling I may know what it is.....when I compile letter.prg without -l, I get this:
C:\LET_1902>clipper letter
Clipper (R) 5.2e
Copyright (c) 1985-1995, Computer Associates Internationa
Microsoft C Floating Point Support Routines
Copyright (c) Microsoft Corp 1984-1987. All Rights Reser
311K available
Compiling LETTER.PRG
Compiling STD_INIT.PRG
Compiling BORDERS.PRG
Compiling VAR_INIT.PRG
Compiling U_SCROLL.PRG
Compiling SAV_SCRN.PRG
Cannot open, assumed external
Compiling SCRL_RET.PRG
Compiling RST_SCRN.PRG
Cannot open, assumed external
Compiling READ_REC.PRG
Compiling WRIT_REC.PRG
Compiling SCRL_TOS.PRG
Compiling LJ_SETUP.PRG
Compiling STD_SETS.PRG
Compiling STD_CLRS.PRG
Compiling STD_MSGS.PRG
Compiling U_SKIP.PRG
Compiling U_SKIP_B.PRG
Code size 13173, Symbols 4592, Constants 4283
I have SAV_SCRN and RST_SCRN located in my EXTRA.PRG (which is what I renamed my Functions.prg). I compiled EXTRA.PRG first (clipper Extra) and then my LETTER.PRG (clipper Letter) and then reran my .BAT file and still get the above error. I don't understand why it will not recognize SAV_SCRN and RST_SCRN even when I made sure I compiled them under 5.2. I think once these are recognized, my system may be better??
Recompiling Old Summer87 Program
Enviado: 16 Mai 2012 16:53
por Pablo César
Ohhh one light !
I have SAV_SCRN and RST_SCRN located in my EXTRA.PRG (which is what I renamed my Functions.prg).
So, in this case could split EXTRA.PRG into SAV_SCRN.prg and RST_SCRN.prg ? Otherwise you will need to find "
DO SAV_SCRN" and "
DO RST_SCRN" in which Clipper call these modules for compiling and execute too (this is a old way for development) and replace for their functions names.
Let-me ask: in those in EXTRA.PRG is there these functions names SAV_SCRN or RST_SCRN ?
I don't understand why it will not recognize SAV_SCRN and RST_SCRN even when I made sure I compiled them under 5.2. I think once these are recognized, my system may be better??
It is by the reason it is not called as function names (in EXTRA.PRG) or modules names which should it be separated (two prgs).
I have a feeling I may know what it is.....when I compile letter.prg without -l, I get this:
C:\LET_1902>clipper letter
Clipper (R) 5.2e
Copyright (c) 1985-1995, Computer Associates Internationa
Microsoft C Floating Point Support Routines
Copyright (c) Microsoft Corp 1984-1987. All Rights Reser
311K available
Compiling LETTER.PRG
Compiling STD_INIT.PRG
Compiling BORDERS.PRG
Compiling VAR_INIT.PRG
Compiling U_SCROLL.PRG
Compiling SAV_SCRN.PRG
Cannot open, assumed external
Compiling SCRL_RET.PRG
Compiling RST_SCRN.PRG
Cannot open, assumed external
Compiling READ_REC.PRG
Compiling WRIT_REC.PRG
Compiling SCRL_TOS.PRG
Compiling LJ_SETUP.PRG
Compiling STD_SETS.PRG
Compiling STD_CLRS.PRG
Compiling STD_MSGS.PRG
Compiling U_SKIP.PRG
Compiling U_SKIP_B.PRG
Code size 13173, Symbols 4592, Constants 4283
IMHO, you should compile like this but need to split EXTRA.PRG in SAV_SCRN.PRG and RST_SCRN.PRG !!
Recompiling Old Summer87 Program
Enviado: 16 Mai 2012 16:58
por marge0512
Yes, EXTRA.PRG has many functions stored in it. RST_SCRN and SAV_SCRN are stored there also. I will divide them into two separate programs and try it. Thanks!
Recompiling Old Summer87 Program
Enviado: 16 Mai 2012 16:59
por Pablo César
Good !
Recompiling Old Summer87 Program
Enviado: 17 Mai 2012 10:45
por marge0512
Hi! Ok, I tried that. Now I am getting:
Error C2021 Redefinition of procedure or function: 'RST_SCRN'.
I don't understand why the compiler doesn't recognize that function but gives this error when it does. I am researching and found that this function is in the clipper lib but it doesn't have the same name. It is named _SAVESCR in the clipper lib.
Recompiling Old Summer87 Program
Enviado: 17 Mai 2012 10:55
por alxsts
Hi!
This happens when the .PRG fine name is the same of the program main procedure or function. RST_SCRN.PRG has a procedure or function named RST_SCRN inside it. Clipper automatically generates a function with the same name of the .PRG file.
To avoid this, add the /N command line switch: Clipper RST_SCRN /L /N
Recompiling Old Summer87 Program
Enviado: 17 Mai 2012 11:01
por marge0512
Thank you! That compiled fine but how do i stop this error from showing when I do: Clipper LETTER ?
Recompiling Old Summer87 Program
Enviado: 17 Mai 2012 11:09
por marge0512
Ok, sorry. That was a stupid question but I compiled LETTER with /n and got rid of that error but i get a BUNCH of these errors:
U_SKIP.PRG(28) Error C2006 Statement not allowed outside procedure or function
Recompiling Old Summer87 Program
Enviado: 17 Mai 2012 11:15
por alxsts
Hi!
You must add /N to all Clipper calls where the .PRG file name matches it's main function.
This may look strange. It's due to Clipper compatibility with dBase. In dBase and Clipper, a main procedure or function name is not mandatory but Clipper always generates it internally. So, you must tell Clipper not to create it's own procedure name when you have yours.
Recompiling Old Summer87 Program
Enviado: 17 Mai 2012 11:16
por Pablo César
RST_SCRN is function or PRG name ?
When you split EXTRA.PRG in SAV_SCRN.prg and RST_SCRN.prg inside of each SAV_SCRN.prg and RST_SCRN.prg, are mentioning:
Function SAV_SCRN or Procedure SAV_SCRN ?
Function RST_SCRN or Procedure RST_SCRN ?
Other questions:
1. In EXTRA.PRG remain anything extra code not being from SAV_SCRN.prg and RST_SCRN.prg ?
2. In case there is nothing alse than SAV_SCRN.prg and RST_SCRN.prg. In your linking with BLINKER, do you took out EXTRA ?
Recompiling Old Summer87 Program
Enviado: 17 Mai 2012 11:22
por marge0512
RST_SCR and SAV_SCR are actually procedures. I named them as .prgs when I took them out of EXTRA.PRG. There are many functions stored in EXTRA.PRG and some of those functions call for SAV_SCR and RST_SCR but no, I do not have EXTRA listed in my linking with Blinker. I took it out.
Recompiling Old Summer87 Program
Enviado: 17 Mai 2012 11:32
por Pablo César
RST_SCR and SAV_SCR are actually procedures.
May you show 5 first line of each RST_SCR and SAV_SCR prgs ?
Recompiling Old Summer87 Program
Enviado: 17 Mai 2012 11:36
por marge0512
Sure! I will show the complete procedures:
SAV_SCRN.prg
Código: Selecionar todos
*----------------------------------------------------------------------
* SAV_SCRN Save the current screen to a mem var
*----------------------------------------------------------------------
procedure SAV_SCREEN
parameters SCRN_NUM
if pcount() < 1
SCRN_NUM = LAST_SCRN() + 1
endif
private SCR_VAR
SCR_VAR = "_SCR_" + ltrim( str( SCRN_NUM))
public &SCR_VAR
save screen to &SCR_VAR
return
RST_SCRN.prg
Código: Selecionar todos
*----------------------------------------------------------------------
* RST_SCRN Restore a screen from a mem var
*----------------------------------------------------------------------
procedure RST_SCRN
parameters SCRN_NUM, KEEP_SCR
if pcount() < 1
private SCRN_NUM
SCRN_NUM = LAST_SCRN()
endif
if pcount() < 2
private KEEP_SCR
KEEP_SCR = 0
endif
private SCR_VAR
SCR_VAR = "_SCR_" + ltrim( str( SCRN_NUM))
restore screen from &SCR_VAR
if KEEP_SCR = 0
release &SCR_VAR
endif
return
Recompiling Old Summer87 Program
Enviado: 17 Mai 2012 11:52
por Pablo César
You see in RST_SCRN.prg there is same file name and same function name. Do you know how it is calling RST_SCRN in another modules ? May you show in one line ? We have to be sure that all calling RST_SCRN, must be same way in all modules which is calling.
It could be:
1.Option: RST_SCRN(<numeric>,<numeric>)
or
2.Option: DO RST_SCRN WITH <numeric>,<numeric>
Tell if is only one way or both. In case of both, remake as 2nd option. Then you can take out "procedure RST_SCRN" (4th line in RST_SCRN.prg).
Recompiling Old Summer87 Program
Enviado: 17 Mai 2012 12:03
por marge0512
RST_SCRN gets called from the LETTER.PRG several times. A couple of examples are:
Código: Selecionar todos
* Act on menu selection
*----------------------
Do case
Case SCRLMNUKEY = 0
* Just return to U_SCROLL
Case SCRLMNUKEY = K_ESC
Do SCRL_RET
Do Rst_Scrn
m->Spin = "N"
Return
Another would be:
Código: Selecionar todos
Do Case
Case Action = 0
* Return and do nothing
Do Rst_Scrn
Return
Case Action = 1
* Name to find
Do Fnd_Na
Do Rst_Scrn
Return
Case Action = 2
* Number to find
Do Fnd_SS
Do Rst_Scrn
Return
EndCase
All examples are about the same. I hope this helps.