×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Journal str = GetInputString(s1, s2, input_str) how to distiguish between cancel and nul string

Journal str = GetInputString(s1, s2, input_str) how to distiguish between cancel and nul string

Journal str = GetInputString(s1, s2, input_str) how to distiguish between cancel and nul string

(OP)
Hi

One of the user alowed input is nul string So in the following command

str = GetInputString(s1, s2, input_str)

How I can distiguish between a 'cancel' and a 'nul string'

Thanks in advanced

RE: Journal str = GetInputString(s1, s2, input_str) how to distiguish between cancel and nul string

One trick is to use a single space character as the initial input string; if the user presses OK, the single space string will be returned, if the user presses cancel, a null string will be returned.

http://www.nxjournaling.com/content/user-input-inp...

www.nxjournaling.com

RE: Journal str = GetInputString(s1, s2, input_str) how to distiguish between cancel and nul string

(OP)
My journal use the iput_str to display info to the
User and the user can change or delete this info
So I can not use a space

Thank you for the this respont

RE: Journal str = GetInputString(s1, s2, input_str) how to distiguish between cancel and nul string

Is a null string a valid response from the user? If so, I don't know of a good way to distinguish between a "cancel" operation or a null input operation. Perhaps a custom input form would solve your issue.

www.nxjournaling.com

RE: Journal str = GetInputString(s1, s2, input_str) how to distiguish between cancel and nul string

(OP)
yes I was suspected that
Do I can insert a custom form inside a loop
My journal is going to repeatedly let the user
select something and the journal will display adequate
info and the user can change or delete this info

Thank you for trying to help

RE: Journal str = GetInputString(s1, s2, input_str) how to distiguish between cancel and nul string

Quote (a984928)

Do I can insert a custom form inside a loop

If you have a block styler license, you should probably use that. If you are working on a Windows machine with no block styler license, you can use a Winform:
http://www.nxjournaling.com/content/using-winforms...

I've heard of others creating custom input forms through Java or Python, but I don't have any examples of that.

www.nxjournaling.com

RE: Journal str = GetInputString(s1, s2, input_str) how to distiguish between cancel and nul string

(OP)

If I take the example from
http://www.nxjournaling.com/content/using-winforms...

Do I can do this

While SelectNoteorLabel(obj, cursor) = Selection.Response.Ok

'My code here

'display our form
myForm.ShowDialog()

If myForm.Canceled Then
'user pressed cancel, exit journal
Return
Else
'user pressed OK, assign value from form to part attribute
_attributeValue = myForm.AttributeValue
workPart.SetUserAttribute(_attributeTitle, -1, _attributeValue, Update.Option.Later)

End If

'My code here

End While

Thank you again

RE: Journal str = GetInputString(s1, s2, input_str) how to distiguish between cancel and nul string

I'm not sure that exact code will run as-is, but you should be able to accomplish what you need with something similar.

www.nxjournaling.com

RE: Journal str = GetInputString(s1, s2, input_str) how to distiguish between cancel and nul string

(OP)
I understand
OK
thank you

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources