Hi
Can anyone help?
I need to generate a TXT file
Previously in my Clipper DOS program I could SET Printer to filename
This does not seem to be available in HMG
Creating a text file
Moderator: Rathinagiri
Re: Creating a text file
Español:
Hola,
El comando: Set Printer to <filename>
No esta disponible en la Librería HMG, pero si en Harbour
Ingles: (Google)
Hello,
The command: 'Set Printer to <filename>'
In the HMG library is unavailable. But if Harbour.
Slds.
Walter
Hola,
El comando: Set Printer to <filename>
No esta disponible en la Librería HMG, pero si en Harbour
Ingles: (Google)
Hello,
The command: 'Set Printer to <filename>'
In the HMG library is unavailable. But if Harbour.
Slds.
Walter
Nada se pierde. Todo se transforma. (Lavoussier)
Nothing is lost. Everything changes.
Nothing is lost. Everything changes.
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Creating a text file
You can use
This works in HMG.
Code: Select all
set alternate to 'x.txt'
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Creating a text file
Set Alternate works
My thanks,
Never had the need to use this in Clipper
My thanks,
Never had the need to use this in Clipper
Re: Creating a text file
Este post creo que te vendrá muy bien.
This post will solve your doubts.
viewtopic.php?f=5&t=1192&p=8483&hilit=writefile#p8483
This post will solve your doubts.
viewtopic.php?f=5&t=1192&p=8483&hilit=writefile#p8483
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Creating a text file
fread() / fwrite() ... etc are low-level functions and I'm always afraid LL approaches
For building a text file programmatically my favorite way is something like this :
Regarding "viewing a text file", IMHO best way is EDITBOX; something like this:
That's all
PS: Don't hesitate about 64 K limit, it left in DOS
Regards / Saludos
--
Esgici
For building a text file programmatically my favorite way is something like this :
Code: Select all
cText := ''
...
<beginning of (probably necessarily) a loop ( FOR / WHILE ... ) >
...
cLine := <somethings >
cText += cLine + CRLF
<end of loop>
HB_MEMOWRIT( <output file name>, cText )
Code: Select all
<NameOfEditboxControl>.value := MEMOREAD( <inputTextFileName> )
PS: Don't hesitate about 64 K limit, it left in DOS
Regards / Saludos
--
Esgici
Viva INTERNATIONAL HMG
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Creating a text file
Addendum to Esgici,
It is better to have the font of the editbox to be 'Courier New' so that the spacing will be equal between characters. Hmm. Good old days!
It is better to have the font of the editbox to be 'Courier New' so that the spacing will be equal between characters. Hmm. Good old days!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Creating a text file
Yes my friendrathinagiri wrote: It is better to have the font of the editbox to be 'Courier New' so that the spacing will be equal between characters. Hmm. Good old days!
Or FixedSYS
In addition make background color to black and live a little nostalgia
Regards
--
Esgici
Viva INTERNATIONAL HMG