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!

LINEFEEDS

Status
Not open for further replies.

ok1397

Technical User
Feb 7, 2005
70
US
does anyone know how to get rid of line feeds in editbox, when a dialogbox opens ??? thank you in advance
 
Thank you anyway knob, the problem is that I have a Main Menu dialogbox, which has 4-pushbuttons that opens up other dialog boxes when clicked. These dialog boxes have editboxes that prompts the user for info, what happens is in the edit box, a character already appears at the prompt, if should be empty until the user inputs information. Any suggestions ????

Thank you,
 
You could initialize the string variable(s) for the editboxes to an empty string just before opening the dialog box and use the DEFAULT option for them. I think that should eliminate any eroneous characters.
(not sure why they're there but that should fix it anyway.

Otherwise I think you'd need to provide your code to try to find out how it is happening.
At least the dialogbox code and any references to the string variables for the editboxes prior to it...
 
HI det07
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 think you can try this:

IF PUSHBUTTON 2 CLICKED THEN CALL THE FOLLOWING DIALOB BOX:
;******** CODE FOR THE LOOKUP DIALOG BOX **********
proc main
string TextStr = "" ; set the string to empty
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 20 DEFAULT ; Length has to be longer than ZERO

you can try commenting out setting the string = "" as it may not be neceessary, but it shouldn't hurt anything.
; to be able to type anything in the editbox
pushbutton 3 22 36 50 12 "OK" OK DEFAULT
pushbutton 4 88 37 52 11 "Cancel" CANCEL
enddialog ;Exit dialog box

***********************************************************
***********************************************************

I believe your problem was the 0 at the end of the line:

editbox 2 47 17 64 12 TextStr 0


The format for the command is:
editbox id left top width height strvar [strlength]
[MASKED] [MULTILINE]

Since you have an integer after the strvar (string variable) it is being used as the maximum length of the string to type in the editbox. With the maximum set at 0 (zero) you are not letting any characters be typed into the editbox. Probably not a case that Aspect developers spent much time debugging, possibly resulting in the weird display issues you are getting...

Hope this helps.


DET07
 
I thought the 0 would cause the problem as well, but I was still seeing the problem when I removed that value from his script. I do think it was a case the developers didn't think about because why would you want an editbox that couldn't accept input?

 
Apparently the only way to get rid of the character was to change the string declaration to: string TextStr="" this worked fine. I wonder if this problem was fixed in newer versions of procomm? I'm currently using 4.7
Thank you all for your help

ok1397
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top