Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running a text file directly from a menu
Message
From
21/07/2004 13:35:50
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
21/07/2004 12:58:46
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00926569
Message ID:
00926650
Views:
24
The "comm" variable, in your sample, isn't complete.

You might place the entire command to run into the "comm" variable:
comm = "run /n start " + filename
on selection bar ... &comm
Or:
on selection bar ... run start /n &filename
Your code can be simplified in some places, too.

For instance:
seek('O')
i=1
do while(AsbDoc.ad_menu='O')
	 DEFINE BAR i of oth PROMPT AsbDoc.ad_label
	 comm=alltrim(AsbDoc.ad_command)
	 ON SELECTION BAR i of oth &comm
	 i=i+1
	 skip
enddo	
Can be simplified with a SCAN loop:
seek('O')
i=1
scan while(AsbDoc.ad_menu='O')
	 DEFINE BAR i of oth PROMPT AsbDoc.ad_label
	 comm=alltrim(AsbDoc.ad_command)
	 ON SELECTION BAR i of oth &comm
	 i=i+1
endscan
Or the following:
go top

DO WHILE !EOF()
	recno=recno()
	replace AsbDoc.ad_command with 'do txt with '+ alltrim(str(recno))
	SKIP	
ENDDO
can be changed to a single REPLACE command:
replace all AsbDoc.ad_command with 'do txt with '+ alltrim(str(recno()))
>Hi Hilmar,
>
>My problem is where do I put this command 'run /n start c:\docs\PostList.txt
>' because the submenu is picking up the name from the label field and If I add this command to the prg I am using to bring up the submenu then system crashes.
> ...
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform