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

WRITETEXT in programs

SOLVED
Highlighted
Regular Member

WRITETEXT in programs

Why isn't writetext working in programs?

 

 test.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: WRITETEXT in programs

Could it be that your problem is a simple typo? Shouldn't the "1" highlighted in the picture be a "2"?

B.png

View solution in original post

9 REPLIES 9
Highlighted

Re: WRITETEXT in programs

Apart from the (real) possibility that they (PTC) didn't think that users would actually want to use WRITETEXT in a program (nothing in the help files indicates, let alone describes how, you could use it in a program):

I see no error (message) in the picture you provided. Please provide (also) a worksheet.

You only defined the 'check' variable in terms of a (little) program.

In order to actually execute the WRITETEXT function in that little program, it must be evaluated. Did you try evaluating check yet?

To evaluate check type:

check=

 

Success!
Luc

Highlighted

Re: WRITETEXT in programs

No success here so far...

check.PNG

Highlighted

Re: WRITETEXT in programs

This (picture) does not show it is not working (neither that it is).

 

Luc

Highlighted

Re: WRITETEXT in programs

Did you save the worksheet that contains this? Did you check the contents of the directory where it is saved to (should be equal to what

CWD=

shows)

And do you have sufficient rights to create a file in the directory that CWD points to?

 

Luc

Highlighted

Re: WRITETEXT in programs

I'll post the whole testfile once again.

The file contains 2 files that should be written. The first one is written regardless of the check, and it actually is in the folder.

The other one in the program is not written, though it should be in the same folder.

check.PNG

Highlighted

Re: WRITETEXT in programs

WRITETEXT does not recover data from a file, for that you need READTEXT.  I'm not sure what your check routine is supposed to do.  Try the example from the help files:

Capture.PNG

Highlighted

Re: WRITETEXT in programs

No, we're just talking about writing to files.

The problem is, that I haven't managed to write to file if the code is in a program component.

Highlighted

Re: WRITETEXT in programs

Could it be that your problem is a simple typo? Shouldn't the "1" highlighted in the picture be a "2"?

B.png

View solution in original post

Highlighted

Re: WRITETEXT in programs

YES, it could be as simple as that!

Announcements