cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

write a text file

Relayman
1-Newbie

write a text file

Hi,

In MCAD 15 I have a sheet that has lots of math variables whose names start with the letter d. e.g. dVAR1, dVAR2.

Is it possible to write code in MCAD that would read through the entire sheet and write those variables and their value to a text file?

e.g. dVAR1 = 4.50

dVAR2 = 11.75

best regards,

russ

4 REPLIES 4
MikeArmstrong
5-Regular Member
(To:Relayman)

Yes.

In MCAD 15 I have a sheet that has lots of math variables whose names start with the letter d. e.g. dVAR1, dVAR2.

e.g. dVAR1 = 4.50

dVAR2 = 11.75

Do you want to keep them in exactly that format?

What do you intend to do with file after? Because this will dictate the method used.

Mike

Mike,

The plan is to write them to a text file and keep their exact variable name but trim off that leading d. This would be something that was "executed" manually after I'm satisfied with what i've done in the sheet. The end product being a text file with all those variables and their values and comments.

I would want it to look like the following so text is mixed in with numeric values.

e.g.

[BLOCK A]

QUAL=FAVORABLE

[1]

VAR1,"4.50"

VAR2,"11.79"

[2]

VAR3,"114.85"

VAR4,"UNFAVORABLE"

VAR5,"400"

thanks,

russ

MikeArmstrong
5-Regular Member
(To:Relayman)

Have a look at my example below. With a little bit of formatting that can be done.

Mike

MikeArmstrong
5-Regular Member
(To:Relayman)

Have a look at the attached worksheet, I was trying to use the WRITEPRN function but the text file was displaying the result as a matrix.

I have used a scripted component curiosity of Richards 'Extra Components' worksheet. Hit F9 over the icon to get the function to execute. Also change the path to your desired location.

Mike

Top Tags