Subject |
Re: dBASE 11, Command Window |
From |
Mervyn Bick <invalid@invalid.invalid> |
Date |
Sat, 12 Apr 2025 13:26:31 +0200 |
Newsgroups |
dbase.getting-started |
On 2025/04/11 18:10, Norman Snowden wrote:
>
> I recently wrote this program that separates and prints data about people who are employed from a list of people who otherwise have different characteristics. The program works fine within dBASE 11. However, when I make it into an Executable it executes and runs but will not use the command window to print the employment names. I have an Ini file included in the group of Files set to Build. I would appreciate any help. Norman
As Ken has pointed out, no .EXE has access to the Command Panel.
Ideally you should create a report to display the output. You could
then either include a reportViewer object on your form or render the
report outside of your form.
If you don't want to do this and you have enough space to include an
editor control on your form then you can modify your code to populate
the editor.
If you don't have the space to include the editor control write each
line to a text file and then use openURL() in miscapi.prg in the dUFLP
to display the file once it has been saved.
>
> function ENTRYFIELD9_onLeftDblClick(flags, col, row)
CRLF = chr(13)+chr(10)
form editor1.value = '' // clear editor
> form.pagno = 3
> Go Top
> Clear
> Shell = true
> Count For OCCUPATION > " " to Occ
> If occ = 0
> ? "No Occupations found?"
form.editor1.value+= 'No Ocupations found.'
form.editor1.value += CRLF
> form.pagno = 1
> return
> Endif
> ? " FIRST NAME LAST NAME OCCUPATION EMPLOYER PHONE "
form.editor1.value += " FIRST NAME LAST NAME
OCCUPATION EMPLOYER PHONE "
form.editor1.value += CRLF
Do this with every ? in the rest of your code in function
ENTRYFIELD9_onLeftDblClick()
To write to a file,
>
> function ENTRYFIELD9_onLeftDblClick(flags, col, row)
f = new file()
f.create('occupations.txt') //will overwrite existing file
> form.pagno = 3
> Go Top
> Clear
> Shell = true
> Count For OCCUPATION > " " to Occ
> If occ = 0
> ? "No Occupations found?"
f.puts('No Occupation found')
> form.pagno = 1
> return
> Endif
> ? " FIRST NAME LAST NAME OCCUPATION
EMPLOYER PHONE "
f.puts( " FIRST NAME LAST NAME
OCCUPATION EMPLOYER PHONE ")
Do this with every ? in the rest of your code in function
ENTRYFIELD9_onLeftDblClick()
At the end of the event handler close the file.
.....
Enddo
wait
Form.pageno = 1
f.close()
return
|
|