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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

editbox ???????? CODE ATTACHED, NEED HELP!!!

Status
Not open for further replies.

ok1397

Technical User
Feb 7, 2005
70
US
PROBLEM WITH EDITBOX BELOW IS THE CODE, ANY SUGGESTIONS !!!!
Here's the code for the main menu (I don't know if it's a better idea to use a case statement, but i was just trying if out with a couple of pushbuttons)
;************* Main Menu *****************
proc main
integer status
string TextStr

dialogbox 0 10 20 328 159 3 "Query Main Menu"
text 1 47 8 224 11 "SMITH && DESHIELDS QUERY MENU" center
pushbutton 2 76 31 65 22 "LOOKUP"
pushbutton 3 232 74 70 21 "RECIEVED PO ?"
pushbutton 4 77 72 63 19 "QUOTE REPORT"
text 5 2 34 72 19 "VIEW ORDERS FOR CASH CUSTOMERS" center
text 6 159 76 70 18 "VIEW PURCHASE ORDER INFO" center
text 8 2 75 73 17 "VIEW QUOTES BY SALESMAN" center
pushbutton 9 241 128 59 18 "E&XIT" CANCEL
pushbutton 10 234 32 69 21 "VENDOR # BY PO"
text 11 167 36 62 19 "VIEW VENDOR ORDER #" center
enddialog


dlgevent 0 status
while ! ((status == 2)||(status == 3)||(status == 4)||(status == 9)||(status == 10))
dlgevent 0 status
endwhile

if status == 10 ;if CANCEL clicked exit script
exit
endif

;if status != 4 ;if OK clicked and textbox is empty
;if nullstr TextStr
;usermsg "No text entered." ;display message
;endif
;endif


if status == 2
isfile "L:\procommscripts\LOOKUP.WAX" ; Verifies that File does Exist.
if SUCCESS
execute "LOOKUP.WAX"
else
usermsg "Error opening file !!!!"
endif
endif

if status == 3 ; Verifies that File does exist
isfile "L:\procommscripts\PO.WAX"
if SUCCESS
execute "PO.WAX"
else
usermsg "Error opening file !!!!"
endif
endif

endproc

IF PUSHBUTTON 2 CLICKED THEN CALL THE FOLLOWING DIALOB BOX:
;******** CODE FOR THE LOOKUP DIALOG BOX **********
proc main
string TextStr
integer status

dialogbox 0 8 22 158 65 3 "Look Up Cash Customer"
text 1 13 2 142 11 "Enter customer's first or last name or address:" left
editbox 2 47 17 64 12 TextStr 0
pushbutton 3 22 36 50 12 "OK" OK DEFAULT
pushbutton 4 88 37 52 11 "Cancel" CANCEL
enddialog ;Exit dialog box

dlgevent 0 status
while ! ((status == 3)||(status == 4))
dlgevent 0 status
endwhile

if status == 4 ;if CANCEL clicked exit script
exit
endif

if status != 4 ;if OK clicked and textbox is empty
if nullstr TextStr
usermsg "No text entered." ;display message
endif
endif

if not nullstr TextStr ;if text box not empty

transmit "Q^M" ;take you to query screen
pause 2
transmit "LOOKUP^M" ;begin query report
pause 1
transmit TextStr
transmit "^M"
pause 1
transmit "T^M"
pause 30
if waitfor "SELECTION" ;if user quits and returns to main menu
exit ;stop script
else
; pause 5 ;else continue waiting and the rest of the code below will finish.
transmit "^M"
pause 0
transmit "Q^M" ;return to main menu
endif
endif
endproc

WHEN THE LOOKUP DIALOG BOX DISPLAYS IT HAS SIMILAR TO "|" IN BOLD AT THE EDITBOX WHERE THE BLINKING CURSOR IS. ANY HELP WILL BE GREATLY APPRECIATED, AND THANKS FOR REPLYING...
 
I can't explain why, but change the declaration of TextStr in lookup.was to read:

string TextStr = ""

For some reason, this value is getting set to something not null when you execute lookup.wax from the main script, but not when run manually. I commented out the declaration of TextStr from the main script, thinking this would solve the problem, but it did not.


 
knob,
I changed the declaration string TextStr="" in the lookup.wax script instead of the main script and it worked !!!!!

Thanks for your help.....
 
Here is an email I got from the developer of ASPECT last week which explains what you were seeing:

This is an often overlooked behavior that's completely normal. Local variables don't have pre-initialized values - by definition, their values are undefined. The only reason a block character is showing up is because there was a non-printable value already in that location on the stack used
in a previous call. In this case it was the value of local variable status from the TEST.WAS parent script's main procedure. Consider this script:

proc main
a()
b()
c()
endproc

proc a
string x = "a"
usermsg x
endproc

proc b
string x
usermsg x
endproc

proc c
string x
usermsg x
endproc

Every usermsg will display the same text "a" even though local variable x is not assigned a value in procedures b and c. This predictable behavior despite being somewhat unexpected behavior.

General rule: Always initialize your local variables before using them in commands which expect incoming values.

 
HI knob,
Thanks for following up on this issue. I have a question, how can i upload files using ftp, only the files with, for example .csv files. and transfer them from the server to a local machine ????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top