Computing.Net > Forums > Disk Operating System > Assigning values to variables (Please help)

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Assigning values to variables (Please help)

Reply to Message Icon

Name: Joey
Date: August 20, 2000 at 17:05:44 Pacific
Comment:

Hello, I know how to assign values to variables. its...
Set variable=10 ... It will give variable a value of 10 but my question is this... Say I have a text file that contains a text "Hello World", how do I get the message "Hello World" to a variable..

Please note that the text file changes it's message, it could be "hello Australia" today and "hello NZ" tomorrow. In other words the solution can't be a hard-code such as
variable="hello world" it needs to be something that assigns the value of the text file to a variable

Thanks very much...
Joey



Sponsored Link
Ads by Google

Response Number 1
Name: Wally
Date: August 20, 2000 at 18:06:47 Pacific
Reply:

I don't know what program you are talking about specifically. Most programming languages have a CONCATENATE command which connects 2 or more text strings.

There is probably a command in whatever language you are talking about, similar to

Set UNKNOWN=Get variable (New Zealand or Minnesota or Bolivia)

Then CONCATENATE "HELLO" & UNKNOWN


0

Response Number 2
Name: Joey
Date: August 20, 2000 at 18:43:37 Pacific
Reply:

I'm talking about programming it in DOS... All I want is to be able to catch the contents of a text file and store it on a variable.
For example... If I go..
c:\type joey.txt
then that text files content is...
Hello World (it will show on the command prompt)
Hello World
Now... How do I store that output to a variable in DOS (using batch files). thanx


0

Response Number 3
Name: Laurence
Date: August 20, 2000 at 22:05:10 Pacific
Reply:

There are actually several methods. See #32 "Get input from file into variable" on my tricks page for one such method.


0

Response Number 4
Name: Joey
Date: August 21, 2000 at 14:21:39 Pacific
Reply:

thanx very much :)


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


TSR programm, to check an... Borland BWCCENA.DLL Wante...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Assigning values to variables (Please help)

please help www.computing.net/answers/dos/please-help/3010.html

Please help! end-if block w/qbasic! www.computing.net/answers/dos/please-help-endif-block-wqbasic/12943.html

Suspend to disk signature, please help www.computing.net/answers/dos/suspend-to-disk-signature-please-help/7875.html