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!

Converting JustStem function from Foxpro 8 to Foxpro5 2

Status
Not open for further replies.

FredGB

Technical User
Sep 22, 2000
12
0
0
GB
I need to compile a Foxpro 8 project in Foxpro 5. On building the application I get errors on the JustStem and JustPath functions ( which don't exist in Foxpro 5). Therefore I need to rewrite these so Foxpro 5 will allow the build. If anyone has the code which will emulate either or both of these functions I would be very grateful for any pointers on how to code these.
 
Fred,
And if you don't want to use (and distribute) FoxTools.FLL, you can find these functions in code in genmenu.prg. Just do:
Code:
modi comm home()+"genmenu"
and then do a Find on these functions - each is only about 15-20 lines.

Rick
 
Quite a while back I wrote my own dBase code to emulate several VFP functions that weren't in my version of dBase, including the JUST*() functions, and you can see if any of them are helpful: faq290-3518

Code:
********
FUNCTION JUSTDRIVE  && X:
PARAMETER in_mystr
RETURN IIF(LEN(in_mystr)>1.AND.SUBSTR(in_mystr,2,1)=":",LEFT(in_mystr,2),"")

********
FUNCTION JUSTPATH   && DRIVE:\FULL\PATH  (INCLUDE X:\ BUT NOT "\" AFTER PATH)
PARAMETER in_mystr   && BLANK IF NO "\" IN STRING
RETURN IIF("\"$in_mystr,SUBSTR(in_mystr,1, ;
           MAX(MAX(AT(":",in_mystr),RAT("\",in_mystr)-1), ;
           IIF(LEN(in_mystr)>2.AND.SUBSTR(in_mystr,2,2)=":\",3,0))),"")

********
FUNCTION JUSTFNAME  && FILE.NAME.EXT  (CALLS JUSTPATH())
PARAMETER in_mystr
PRIVATE c_talk, n_lenpath
IF SET("TALK")="ON"
   SET TALK OFF
   c_talk="ON"
ELSE
   c_talk="OFF"
ENDIF
* JUSTPATH() IS EMPTY DRIVE SPECIFIED BUT NOT PATH SO TEST FOR ":"
n_lenpath=MAX(LEN(JUSTPATH(in_mystr)),IIF(":"$in_mystr,2,0))
IF c_talk="ON"
   SET TALK ON
ENDIF
RETURN IIF(LEN(in_mystr)>n_lenpath,STRTRAN(SUBSTR(in_mystr,n_lenpath+1),"\"),"")

********
FUNCTION JUSTSTEM  && FILE.NAME WITHOUT .EXT  (CALLS JUSTFNAME(),JUSTPATH())
PARAMETER in_mystr
PRIVATE c_talk, cfname
IF SET("TALK")="ON"
   SET TALK OFF
   c_talk="ON"
ELSE
   c_talk="OFF"
ENDIF
cfname=JUSTFNAME(in_mystr)
IF c_talk="ON"
   SET TALK ON
ENDIF
RETURN IIF("."$cfname,SUBSTR(cfname,1,RAT(".",cfname)-1),cfname)

********
FUNCTION JUSTEXT   && EXT  (AFTER RIGHTMOST ".")
PARAMETER in_mystr
RETURN IIF("."$in_mystr.AND.RIGHT(in_mystr,1)<>".", ;
           SUBSTR(in_mystr,RAT(".",in_mystr)+1),"")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top