1. Win32lib setText
- Posted by "H.W Overman" <euman at bellsouth.net> Nov 11, 2003
- 547 views
Hey all, Using Win32lib v.59.1 I seem to have an issue with setText to SLE Edit controls. If I specifically send a string sequence e.g; setText(Diag[i],"work") this seems fine but, if I return a string sequence from a buffer it doesnt work correctly. Has anyone else ran across this? Euman
2. Re: Win32lib setText
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Nov 11, 2003
- 537 views
----- Original Message ----- From: "H.W Overman" <euman at bellsouth.net> To: <EUforum at topica.com> Subject: Win32lib setText > > > Hey all, > > Using Win32lib v.59.1 I seem to have an issue with setText to SLE Edit > controls. > If I specifically send a string sequence e.g; setText(Diag[i],"work") > this seems fine but, if I return a string sequence from a buffer it doesnt > work correctly. > > Has anyone else ran across this? <soapbox>Please be a LOT more explicit when asking for help. This request is *way* to vague for anyone to guess correctly what your problem is.</soapbox> Its not much use just saying "it doesnt work correctly" because that does not give us any information to help you. It would be better if you said what *does* happen rather than what does not happen. For example, is it displaying nothing or displaying strange characters? And what does "return a string sequence from a buffer" actually mean? I guess you are using an API functon which is returning a zero-terminated string at a RAM location and you are getting that string out of RAM and converting it to a sequence then using setText(). Can you see what is in the sequence-string before calling setTExt() using the trace or even the '?' method? What is the contents? Are you sure you are fetching the string correctly from RAM? What is the API routine you are using? Is it just this API routine or all API routines that return a RAM string? Can you display the sequence string in a console window? -- Derek
3. Re: Win32lib setText
- Posted by "H.W Overman" <euman at bellsouth.net> Nov 11, 2003
- 529 views
>From: "Derek Parnell" <ddparnell at bigpond.com> >> ----- Original Message ----- >> From: "H.W Overman" <euman at bellsouth.net> > > Hey all, > > > > Using Win32lib v.59.1 I seem to have an issue with setText to SLE Edit > > controls. > > If I specifically send a string sequence e.g; setText(Diag[i],"work") > > this seems fine but, if I return a string sequence from a buffer it doesnt > > work correctly. > > > > Has anyone else ran across this? > > <soapbox>Please be a LOT more explicit when asking for help. This request is *way* to vague for anyone to guess correctly what your problem is.</soapbox> > There must be more than one way to retrieve a string from a buffer, I know of only one way... sorry for not being specific. > Its not much use just saying "it doesnt work correctly" because that does not give us any information to help you. No (0) string is inserted into the SLE. >For example, is it displaying nothing or displaying strange characters? No (0) string is inserted into the SLE. (nothing displayed) >And what does "return a string sequence from a buffer" actually mean? >I guess you are using an API functon which is returning a zero-terminated string at a RAM location and you are getting that string out of RAM and converting it to >a sequence then using setText(). Your a very good guess Derek, I need to know how to convert the z-string to a sequence suitable for use with setText >Can you see what is in the sequence-string before calling setTExt() using the trace or even the '?' method? What is the contents? >Are you sure you are fetching the string correctly from RAM? What is the API routine you are using? >Is it just this API routine or all API routines that return a RAM string? >Can you display the sequence string in a console window? YES! The string /s do show up in a console window, this makes me think there may be something wrong with setText or, Im not sure how I need to convert the z-string to acceptable sequence suitable for use with setText > -- > Derek Euman
4. Re: Win32lib setText
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Nov 11, 2003
- 551 views
----- Original Message ----- From: "H.W Overman" <euman at bellsouth.net> To: <EUforum at topica.com> Subject: Re: Win32lib setText > > > >From: "Derek Parnell" <ddparnell at bigpond.com> > > >> ----- Original Message ----- > >> From: "H.W Overman" <euman at bellsouth.net> > > > > Hey all, > > > > > > Using Win32lib v.59.1 I seem to have an issue with setText to SLE Edit > > > controls. > > > If I specifically send a string sequence e.g; setText(Diag[i],"work") > > > this seems fine but, if I return a string sequence from a buffer it > doesnt > > > work correctly. > > > > > > Has anyone else ran across this? > > > > <soapbox>Please be a LOT more explicit when asking for help. This request > is *way* to vague for anyone to guess correctly what your problem > is.</soapbox> > > > > There must be more than one way to retrieve a string from a buffer, I know > of only one way... > sorry for not being specific. > > > Its not much use just saying "it doesnt work correctly" because that does > not give us any information to help you. > > No (0) string is inserted into the SLE. > > >For example, is it displaying nothing or displaying strange characters? > > No (0) string is inserted into the SLE. (nothing displayed) > > >And what does "return a string sequence from a buffer" actually mean? > >I guess you are using an API functon which is returning a zero-terminated > string at a RAM location and you are getting that string out of RAM and > converting it to >a sequence then using setText(). > > Your a very good guess Derek, > I need to know how to convert the z-string to a sequence suitable for use > with setText > > >Can you see what is in the sequence-string before calling setTExt() using > the trace or even the '?' method? What is the contents? > >Are you sure you are fetching the string correctly from RAM? What is the > API routine you are using? > >Is it just this API routine or all API routines that return a RAM string? > >Can you display the sequence string in a console window? > > YES! The string /s do show up in a console window, this makes me think there > may be something wrong with setText or, > Im not sure how I need to convert the z-string to acceptable sequence > suitable for use with setText > > > -- > > Derek > I continue to no problem with this on my system. Here is some example code... --------------------- without warning include win32lib.ew integer Win, TPath, Btn Win = create(Window, "Temporary File Path", 0, 0,0, 400, 200, 0) TPath = create(SleText, "NOTHING HERE YET", Win, 10, 10, 350, 25, 0) Btn = create(Button, "Get Path", Win, 10, 55, 100, 25, 0) procedure Click_Btn(integer self, integer event, sequence parms) atom addr sequence temp_path integer len len = 255 addr = allocate(len) if w32Func(xGetTempPath, {len, addr}) then temp_path = peek_string(addr) else temp_path = ".\\" end if free(addr) setText(TPath, temp_path) end procedure setHandler(Btn, w32HClick, routine_id("Click_Btn")) WinMain( Win, Normal) --------------------- Again, I ask ... What does the sequence contain? In other words, can you show me, in a reply email, the elements that make up the sequence you are trying to set the SLE to? -- Derek
5. Re: Win32lib setText
- Posted by "H.W Overman" <euman at bellsouth.net> Nov 12, 2003
- 566 views
Hey guys, Never mind, but thanks alot...seems this one was a issue where someone had cleared the control sequence just before calling setText so no control ID's where retained and this threw me off. Darned code! I couldnt explain this until I started to write a better demo for Derek so Derek, you indirectly solved my problem.....Thank you! You read this bubbashrimp your program is fixed.... Euman ----- Original Message ----- From: "Derek Parnell" <ddparnell at bigpond.com> To: <EUforum at topica.com> Sent: Tuesday, November 11, 2003 5:18 PM Subject: Re: Win32lib setText > > > ----- Original Message ----- > From: "H.W Overman" <euman at bellsouth.net> > To: <EUforum at topica.com> > Sent: Wednesday, November 12, 2003 8:16 AM > Subject: Re: Win32lib setText > > > > >From: "Derek Parnell" <ddparnell at bigpond.com> > > > > >> ----- Original Message ----- > > >> From: "H.W Overman" <euman at bellsouth.net> > > > > > > Hey all, > > > > > > > > Using Win32lib v.59.1 I seem to have an issue with setText to SLE Edit > > > > controls. > > > > If I specifically send a string sequence e.g; setText(Diag[i],"work") > > > > this seems fine but, if I return a string sequence from a buffer it > > doesnt > > > > work correctly. > > > > > > > > Has anyone else ran across this? > > > > > > <soapbox>Please be a LOT more explicit when asking for help. This request > > is *way* to vague for anyone to guess correctly what your problem > > is.</soapbox> > > > > > > > There must be more than one way to retrieve a string from a buffer, I know > > of only one way... > > sorry for not being specific. > > > > > Its not much use just saying "it doesnt work correctly" because that does > > not give us any information to help you. > > > > No (0) string is inserted into the SLE. > > > > >For example, is it displaying nothing or displaying strange characters? > > > > No (0) string is inserted into the SLE. (nothing displayed) > > > > >And what does "return a string sequence from a buffer" actually mean? > > >I guess you are using an API functon which is returning a zero-terminated > > string at a RAM location and you are getting that string out of RAM and > > converting it to >a sequence then using setText(). > > > > Your a very good guess Derek, > > I need to know how to convert the z-string to a sequence suitable for use > > with setText > > > > >Can you see what is in the sequence-string before calling setTExt() using > > the trace or even the '?' method? What is the contents? > > >Are you sure you are fetching the string correctly from RAM? What is the > > API routine you are using? > > >Is it just this API routine or all API routines that return a RAM string? > > >Can you display the sequence string in a console window? > > > > YES! The string /s do show up in a console window, this makes me think there > > may be something wrong with setText or, > > Im not sure how I need to convert the z-string to acceptable sequence > > suitable for use with setText > > > > > -- > > > Derek > > > > I continue to no problem with this on my system. Here is some example code... > > --------------------- > without warning > include win32lib.ew > > integer Win, TPath, Btn > > Win = create(Window, "Temporary File Path", 0, 0,0, 400, 200, 0) > TPath = create(SleText, "NOTHING HERE YET", Win, 10, 10, 350, 25, 0) > Btn = create(Button, "Get Path", Win, 10, 55, 100, 25, 0) > > > procedure Click_Btn(integer self, integer event, sequence parms) > atom addr > sequence temp_path > integer len > > len = 255 > addr = allocate(len) > > if w32Func(xGetTempPath, {len, addr}) then > temp_path = peek_string(addr) > else > temp_path = ".\\" > end if > > free(addr) > > setText(TPath, temp_path) > end procedure <snip> > > -- > Derek > > > > TOPICA - Start your own email discussion group. FREE! > >