| View previous topic :: View next topic |
| Author |
Message |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Jun 13, 2007 1:03 am Post subject: What The Heck Am I Doing Wrong?! :-( |
|
|
| Code: | | %W = @winpos(@winexists(~TEXT1),W) |
Ummm, and I doing something wrong in that line of code? I keep getting an error on it.
| Quote: | | Error: Invalid parameter to command |
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Wed Jun 13, 2007 2:54 am Post subject: Re: What The Heck Am I Doing Wrong?! :-( |
|
|
Your problem is the following returns nothing:
I.E. %x will be null if you do this:
| Code: | | %x = @winexists(~TEXT1) |
Which efectively makes your line of code into:
Which obviously has a missing parameter. _________________ cheers
Dave |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Jun 13, 2007 3:21 am Post subject: |
|
|
And the solution is? _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Wed Jun 13, 2007 3:29 am Post subject: |
|
|
| That's odd, can you post the DIALOG CREATE portion of your program. Could be a certain style on the editbox which may be causing a problem. |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Jun 13, 2007 3:33 am Post subject: |
|
|
I sure hope this isn't a Vista related issue..... I just finally upgraded to it and would be bummed out a bit if I can't use me favorite wittle VDS here.
| Code: | DIALOG CREATE,Appbar 2G,-1,0,756,152
DIALOG ADD,STYLE,STYLE1,Tahoma,,,,WHITE
REM *** Modified by Dialog Designer on 6/11/2007 - 16:55 ***
DIALOG ADD,BITMAP,BITMAP1,0,0,756,24,C:\Users\Garrett\Documents\Dev Projects\1-Current Projects\Appbar 2G\skin drafts\Image26.bmp,,STRETCH
DIALOG ADD,BITMAP,BITMAP2,59,28,71,24,C:\Users\Garrett\Documents\Dev Projects\1-Current Projects\Appbar 2G\skin drafts\Image26btn.bmp
DIALOG ADD,TEXT,TEXT1,63,138,,,Appbar 2G,,STYLE1,TRANSPARENT,CLICK
DIALOG SHOW
wait 1
%W = @winpos(@winexists(~TEXT1),W)
warn > %W |
_________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Wed Jun 13, 2007 3:55 am Post subject: |
|
|
Definitely not Vista, or style related, because I get the same thing here in XP Pro with the following code:
| Code: | DIALOG CREATE,New Dialog,-1,0,240,160
DIALOG ADD,TEXT,TEXT1,42,40,,,TEXT1
DIALOG SHOW
%W = @winpos(@winexists(~TEXT1),W)
|
And:
| Code: | DIALOG CREATE,New Dialog,-1,0,240,160
DIALOG ADD,TEXT,TEXT1,42,40,,,TEXT1
DIALOG SHOW
%X = @winexists(~TEXT1)
%W = @winpos(%X,W)
|
I also tried:
| Code: | DIALOG ADD,TEXT,TEXT1,42,40,30,13,TEXT1
|
_________________ cheers
Dave |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Wed Jun 13, 2007 3:59 am Post subject: |
|
|
Hmm, thi sworks fine:
| Code: | DIALOG CREATE,New Dialog,-1,0,240,160
DIALOG ADD,EDIT,EDIT1,42,40,50,18,EDIT1
DIALOG SHOW
%W = @winpos(@winexists(~EDIT1),W)
|
So it seems there's a bug with using winexists to check for a text element. Maybe a text element is not considered a window? _________________ cheers
Dave |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Wed Jun 13, 2007 4:04 am Post subject: |
|
|
Interesting If you change TEXT1 to an EDIT Element it works.
It seems that you can only SET the TEXT element but not GET the TEXT element.
I get the issue on XP and VISTA
Hmmmm.................
BTW - you shouldn't need @WINEXISTS() on your own dialog.
Just use %W = @WINPOS(TEXT1) except appearently it needs to be something other than a TEXT element 
Last edited by Aslan on Wed Jun 13, 2007 4:20 am; edited 1 time in total |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Jun 13, 2007 4:12 am Post subject: |
|
|
I could swear for the life of me that I've been able to get the width of a text element before in VDS. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Wed Jun 13, 2007 4:24 am Post subject: |
|
|
| ahh I figured you renamed your edit box to TEXT1. You are using a text control, the text control is not a windowed control, it draws directly to the form. Since it is not a windowed control, it will not have a window handle - thus the reason you get a null result on @winexists. |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Wed Jun 13, 2007 8:49 am Post subject: |
|
|
Aslan is almost right. You don't need to use @winexists(), but you still need to put the ~ in front of the element name, to tell @winpos that this is an internal element name not the title of a main window. I *think* this should work for all elements, including text elements. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Thu Jun 14, 2007 12:02 am Post subject: |
|
|
Thanks Jules, gave that a try. At least I don't get any error now... Now I just get nothing, which is better than an error, right?
Well nix this idea now anyway.
Wait! Isn't there a @dlgpos() function?....................................
Uh huh! Yup! There sure is and guess what? It freaking works!
Sureeeeee..... I don't feel completely and utterly stupid right now!
Thanks everyone for trying to help me out here. I appreciate it greatly. Maybe next time I'll use the right function for the job instead of trying to force another function to do my dirty work.
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|