Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clipper Conversion to FoxPro 1

Status
Not open for further replies.

SSDESIGN

Programmer
May 11, 2003
71
0
0
US
During the conversion of a Clipper application, the following code was encountered:

m_seek=0=NO m_seek=1=LOOKUP & SHOW m_seek=2=VALIDATE

What is the function of the line and what would be the FoxPro code to replace it?

Thanks for the assistance...
 
That doesn't look like a familiar bit of code construction to me at all.

Can you place it in context?

I would be interested to see more.

Martin

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
I'm wondering if this is meant to be a comment of some kind?

Is the result of something previous is stored in m_seek, and
this explains the contents:

Code:
m_seek=0=NO && implies that a seek perhaps failed to find something

Code:
m_seek=1=LOOKUP & SHOW   && suggests that a seek was successful and the results could be displayed

Code:
m_seek=2=VALIDATE && perhaps something should be validated

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Thanks for the replies....

Here is the code before the line in question.

=============================================
* DO mhdisac WITH 10,20,1
=============================================
* PROGRAM MHDISAC.PRG

PARAMETERS m_l,m_c,m_seek &&DEFAULT PARAMETERS m_l=10 m_c=20

m_pos:=0 && m_seek=0=NO m_seek=1=LOOKUP & SHOW
m_start:=0
=============================================
Thanks for the support....
 
Hi

The lines:

Code:
PARAMETERS m_l,m_c,m_seek &&DEFAULT PARAMETERS m_l=10 m_c=20
m_pos:=0        && m_seek=0=NO m_seek=1=LOOKUP & SHOW

Tell me that my assumption was probably right.

Everything to the right of the double ampersands (&&) is commentary - and not compiled by Clipper, so it can be ignored.

It represents an explanation of what to expect in the parameters and how the program is expected (was at one point expected) to proceed.

Good luck

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
in foxpro, the := doesn't exit.

use this:

m_pos = 0

NOT this, m_pos := 0

Ali Koumaiha
TeknoSoft Inc.
Michigan
 
I missed that - Well done Ali

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
SSDESIGN

Has this helpd?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Thanks for the heads up...

After going through 14,000+ lines of code, I hit several things that did not make sense - this was one of them.

Thanks again...
 
As I continue working on the application, I hit the following code which does not make any sense to me:

FUNCTION predit
PARAMETER perret, perdeal, perjob, perspec, perwhol, ofret, ofdeal, ofjob, ofspec, ofwhol, a_ret, a_deal, a_job, spec, a_whol

PRIVATE x_cost=m_cost=cost, x_pret=m_pret=pret, ; x_pdeal=m_pdeal=pdeal, x_pjob=m_pjob=pjob, ;
x_spec=m_spec=spec, x_whol=m_whol=whole, m_mn

x_cost=m_cost=cost
x_pret=m_pret=pret
x_pdeal=m_pdeal=pdeal
x_pjob=m_pjob=pjob
x_spec=m_spec=spec
x_whol=m_whol=whole

What is being done in the double equal lines?

Thanks for the support...
 
Hi SSDesign

Pretty wonky looking code, I admit.

x=x=z means x will be a logical variable, with a value .t. if y=z, false otherwise.

Strickly speaking in modern clipper it should be coded
x:=x=z, because newer dialects differentiate between the logical is equal (=) operator and the replacement operator :)=).

However I don't know if that is true of Foxpro.

Jock
 
are you sure that's the code verbatim?

or are they commented?

Ali Koumaiha
TeknoSoft Inc.
Michigan
 
The code is verbatim with the one exception of replacing := with an =.

In doing some research, I found the term “Code Blocks” such as:
STORE 0 TO Z,Y,X being the same as Z:=Y:=X:=0
The zero passes to X, then to Y, then to Z

The sample code above compiled without an error. However, when the application is run, the variable m_cost can not be found.

With the statement - "x_cost=m_cost=cost" - I will verify the availability of each variable, create the m_cost variable, and set up a STORE statement for each line to see if a STORE will function as a replacement.

m_cost = 0
STORE x_cost TO m_cost, cost

Thanks for the support...
 
The "Code Blocks" statement is correct except the variable with a value is the last variable in the statement.

x_cost:=m_cost:=cost
is equal to
STORE cost TO x_cost, m_cost
which creates x_cost and m_cost and loads the value
of cost into each variable.

Thanks for the support....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top