Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

toString? 1

Status
Not open for further replies.

jl8789

MIS
May 22, 2003
293
US
Hi, forgive me cuz I'm new with powerbuilder. I just came from programming with Cold Fusion for 5 years and it had the ability to know the diff between strings and ints, and the 2 could be used interchangealby rather easily. Anyway, is there any way I can type cast an integer to be a string? Basically, I have a constant that I want to display in the MessageBox function. I am trying to concatenate the integer in between the strings but it isn't letting me. And I'm having issues trying to assign a string to the integer. Thanks!!!
 
Sorry. I figured it out shortly after the post.
My constant is
int gc_i_max_items

In my script:
string lv_s_max_items

lv_s_max_items = string(gc_i_max_items)
Then the messagebox
MessageBox('Item Retrieval','Selecting more than '+ lv_s_max_items +' items is not allowed.',Exclamation!)
 
You can also use the String( ) function in-line as well...

//global variable...
Integer gi_max

//script...
MessageBox( 'Some Title', 'Cannot have more than ' + String( gi_max ) + ' items.' )


Either way is fine, but I'm lazy, and opt to use the String( ) function embedded more often than not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top