Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Assign print using to a string.
#1
An interesting code snippet to get a string variable from print using:

Code: (Select All)
'sample assigning formatted string from print using to a variable:
Rem x$ = Print Using "###"; 100
X = FreeFile
F$ = "tempfile.bak"
Print "Enter value";
Input Z#: If Z# = 0# Then Z# = 100#
Print "Enter format";
Input Z$: If Z$ = "" Then Z$ = "###"
'write print using value
Open F$ For Output As #X
Print #X, Using Z$; Z#
'read print using value
Close
Open F$ For Input As #X
If EOF(X) = 0 Then
  Line Input #X, S$
  Print S$ ' this is the output value
End If
Close
End
Although I cannot find a more efficient way to do this..

Erik.
Reply


Messages In This Thread
Assign print using to a string. - by eoredson - 03-30-2024, 03:29 AM
RE: Assign print using to a string. - by SMcNeill - 03-30-2024, 04:55 AM
RE: Assign print using to a string. - by eoredson - 03-31-2024, 11:23 PM
RE: Assign print using to a string. - by eoredson - 04-01-2024, 02:54 AM
RE: Assign print using to a string. - by SMcNeill - 04-01-2024, 06:04 AM
RE: Assign print using to a string. - by eoredson - 04-02-2024, 12:52 AM
RE: Assign print using to a string. - by SMcNeill - 04-02-2024, 01:36 AM
RE: Assign print using to a string. - by eoredson - 04-02-2024, 01:49 AM
RE: Assign print using to a string. - by SMcNeill - 04-02-2024, 02:56 AM



Users browsing this thread: 1 Guest(s)