Z-Space Technologies, Inc.
Support Forums
Join | Logon
ITScriptNet Support Forums
 All Threads | New ThreadView:  Search:  
 Author  Thread: IIf Statement Help
swarris
Posts: 3
IIf Statement Help
Posted: 21 Mar 11 2:12 PM
Hello, I'm kind of a newbie when it comes to working with the development tool so I'm hoping someone can give me some guidance with my issue.

I think it's a fairly simple issue but I just can't get the IIF to work..

Example: The user scans a barcod and enters the retail price 199 leaving out the decimal to speed up the process. Currently in the LostFocus Action I've got the following to input the decimal $prompt.retail$ = $prompt.retail$/100 and the result = 1.99 which is displayed in the grid. The problem comes in when the retail is 100, 200, 300 etc.. The $prompt.retail$ = $prompt.retail$/100 converts these to 1, 2, 3 etc which confuses the user..

Below is the iif statement that I'm trying to work with inorder to fix this but it's not working..

@xx@ = right($prompt.retail$,2)
IIf(@xx@ = 00, $prompt.retail$ = $prompt.retail$/100 + .00, $prompt.retail$ = $prompt.retail$/100)
1

With these statements in place I don't get any error messages I just get whatever was typed into the $prompt.retail$ so it's not evaluating the what so ever.

Thanks for your help..
[Reply][Quote]
Bob
Posts: 8
Re: IIf Statement Help
Posted: 22 Mar 11 9:04 AM
This might help?

$prompt.retail$=Format(($prompt.retail$/100),2,1) instead of $prompt.retail$/100

There's information about "Format" under Functions/Conversion when you enter a script.
[Reply][Quote]
swarris
Posts: 3
Re: IIf Statement Help
Posted: 22 Mar 11 11:36 AM
Thanks Bob, that did the trick..

I really appreciate your help..Scott
[Reply][Quote]
 Page 1 of 1 
 
Website (C) 2004-2008 Z-Space Technologies, Inc. All Rights Reserved.
All messages posted here are the sole responsiblity of the poster. Z-Space Technologies, Inc. is not responsible for the content of messages. Messages do not reflect the official positions or policies of Z-Space Technologies, Inc.