forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


What The Heck Am I Doing Wrong?! :-(

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Wed Jun 13, 2007 1:03 am    Post subject: What The Heck Am I Doing Wrong?! :-( Reply with quote

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
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Wed Jun 13, 2007 2:54 am    Post subject: Re: What The Heck Am I Doing Wrong?! :-( Reply with quote

Your problem is the following returns nothing:
Code:
@winexists(~TEXT1)

I.E. %x will be null if you do this:
Code:
%x = @winexists(~TEXT1)

Which efectively makes your line of code into:
Code:
%W = @winpos(,W)

Which obviously has a missing parameter.

_________________
cheers

Dave
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Wed Jun 13, 2007 3:21 am    Post subject: Reply with quote

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
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Wed Jun 13, 2007 3:29 am    Post subject: Reply with quote

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
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Wed Jun 13, 2007 3:33 am    Post subject: Reply with quote

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
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Wed Jun 13, 2007 3:55 am    Post subject: Reply with quote

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
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Wed Jun 13, 2007 3:59 am    Post subject: Reply with quote

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
View user's profile Send private message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Wed Jun 13, 2007 4:04 am    Post subject: Reply with quote

Interesting Confused 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 Wink


Last edited by Aslan on Wed Jun 13, 2007 4:20 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Wed Jun 13, 2007 4:12 am    Post subject: Reply with quote

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
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Wed Jun 13, 2007 4:24 am    Post subject: Reply with quote

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
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Wed Jun 13, 2007 8:49 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Thu Jun 14, 2007 12:02 am    Post subject: Reply with quote

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? Wink

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! Rolling Eyes

Sureeeeee..... I don't feel completely and utterly stupid right now! Confused

Thanks everyone for trying to help me out here. I appreciate it greatly. Smile 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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group