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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

SRIPT EDITOR

johanpg
1-Visitor

SRIPT EDITOR

Hello I am new using script editor, and I think it is a very nice tool, but I have a problem, every time I save a close the file that has the script editor, it does not save my selection, it initialize with the first selection in my string content..., I think it is because the:

Rem Initialize Selection If desired
ListBox.CurSel = 0

Could you please tell me how to keep my selection once I exit the file???

Thank you!!! BTW I am using MathCAD 14


Rem Initialize List Box
ListBox.ResetContent()

Rem Add Strings here as needed
ListBox.AddString("24f-E (DF Only)")
ListBox.AddString("24f_Ex(DF Only)")
ListBox.AddString("20f-E")
ListBox.AddString("20f-Ex")
ListBox.AddString("18t-E (DF) / 14t-E (SPF)")
ListBox.AddString("16c-E (DF) / 12c-E (SPF)")

Rem Initialize Selection If desired
ListBox.CurSel = 0

Sub ListBoxEvent_Start()
End Sub

Sub ListBoxEvent_Exec(Inputs,Outputs)
Outputs(0).Value = ListBox.CurSel + 1
End Sub
4 REPLIES 4
RichardJ
19-Tanzanite
(To:johanpg)

See this thread:

http://collab.mathsoft.com/read?114426,63e#114426

There are a couple of examples, in the second and fourth posts.

Richard

Hello Richard,

Thank you for your help. I used the Metadata to save the values on my ListBoxState.

The issue I have now, is that I am using the same ListBox, with different Inputs in different locations of my calculations.

When I save the file close and reopen it, all my values are now set as the one I saved the last. Is there any way to keep the values as their original input??

Thank you,
Johan

>Is there any way to keep the values as their original input?? <<br> _____________________

Save them in file.

How could I save them in file?
Thank you,
Johan
Announcements

Top Tags