INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Clipper Conversion to FoxPro

Clipper Conversion to FoxPro

(OP)
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...

RE: Clipper Conversion to FoxPro

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 Smileing

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

RE: Clipper Conversion to FoxPro

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 Smileing

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

RE: Clipper Conversion to FoxPro

(OP)
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....

RE: Clipper Conversion to FoxPro

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 Smileing

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

RE: Clipper Conversion to FoxPro

in foxpro, the := doesn't exit.

use this:

m_pos = 0

NOT this, m_pos := 0

Ali Koumaiha
TeknoSoft Inc.
Michigan

RE: Clipper Conversion to FoxPro

I missed that - Well done Ali

Regards

Griff
Keep Smileing

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

RE: Clipper Conversion to FoxPro

SSDESIGN

Has this helpd?

Regards

Griff
Keep Smileing

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

RE: Clipper Conversion to FoxPro

(OP)
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...

RE: Clipper Conversion to FoxPro

(OP)
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...
 

RE: Clipper Conversion to FoxPro

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

RE: Clipper Conversion to FoxPro

are you sure that's the code verbatim?

or are they commented?

Ali Koumaiha
TeknoSoft Inc.
Michigan

RE: Clipper Conversion to FoxPro

(OP)
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...

RE: Clipper Conversion to FoxPro

(OP)
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....
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close