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 


Reading from file, parsing and adding to list
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu May 15, 2003 5:03 pm    Post subject: Reply with quote

GeoTrail,
Are you getting an error message because
Code:
DIALOG SET,Engines,%%Engine
As long as your combo boxes name is Engines and the variable %%Engine does hold the name of the engine. The List put command will only write the name of the engine to the list part of the combo box...
_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Thu May 15, 2003 5:04 pm    Post subject: Reply with quote

If the combo has the LIST style, you should just be able to use the %%temp = @MATCH(COMBONAME,%%Engine) function (thanks for the correction mindpower). Make sure you replace COMBONAME with the name of your combo box.
_________________
"ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player...


Last edited by Hortalonus on Thu May 15, 2003 5:36 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu May 15, 2003 5:29 pm    Post subject: Reply with quote

Hortalonus wrote:
If the combo has the LIST style, you should just be able to use the LIST SEEK,COMBONAME,%%Engine command. Make sure you replace COMBONAME with the name of your combo box.


GeoTrail,
If you use the List Seek command then %%Engine will need to have the item number and not the text of that item. You should use the @Match function.

Code:
List seek,comboname,0
%A = @Match(%%Engine)


I normally do not use the LIST style with the combo box so I am not sure if @match will cause the combo box to display the item if it does not then add this line below.
Code:
List seek,comboname,@index(comboname)

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Thu May 15, 2003 5:38 pm    Post subject: Reply with quote

Laughing Uh... yeah, I'm not sure what that was I just smoked... thanks for the heads up mindpower. My former post has been edited.
_________________
"ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player...
Back to top
View user's profile Send private message Send e-mail
moke
Contributor
Contributor


Joined: 02 Jan 2002
Posts: 162

PostPosted: Thu May 15, 2003 5:44 pm    Post subject: Reply with quote

Just be careful with @match. It will find a match if the string your looking
to match appears in the list item but is not an exact match.

For instance, when searching for MYITEM you would match on any list
item starting with MYITEM.

Myitem-1 would match
Myitem2 would match
Myitem todaY would match
1-myitem would not match

I sometimes use @match along with @equal to be sure i have an exact match

moke
Back to top
View user's profile Send private message Send e-mail
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Thu May 15, 2003 6:30 pm    Post subject: Reply with quote

moke wrote:
I sometimes use @match along with @equal to be sure i have an exact match

A very wise practice! Cool

_________________
"ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player...
Back to top
View user's profile Send private message Send e-mail
Garrett
Moderator Team


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

PostPosted: Thu May 15, 2003 6:54 pm    Post subject: Reply with quote

Easier way to do this, is when you save to your INI or to the REGISTRY,
don't save the name of the item, save the index number instead. When
you open the program again, pull that value from the ini or registry, and
then you can do just a simple list seek.

-Garrett
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu May 15, 2003 8:48 pm    Post subject: Reply with quote

GeoTrail wrote:
Yeah, I know that.
But in this case I wanted to use the %K as a word to be replaced by the %K variable.

Some of the search engines requires a string like
search.php?query=geotrail&language=eng
(search.php?query=%K&language=eng)

so I really should be able to put the variable inside the url string.


Just wanted to make a comment: Why not just change it around so
search.php?query=geotrail&language=eng becomes search.php?language=eng&query=geotrail

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Thu May 15, 2003 9:07 pm    Post subject: Reply with quote

That worked great Hortalonus. Thanks alot.

FreezingFire, Yeah, I've thought about that, but I want users of the program to be able to add more engines them selfs, and it would be easier. Anyways, it's working now Smile

Now I'm gonna make a simple engine editor where users can easily add engines to the url list.

Is VDS 5 out now?



How about now?




OK, now then? Twisted Evil

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 768
Location: Eastman, GA

PostPosted: Thu May 15, 2003 9:39 pm    Post subject: Reply with quote

Garrett wrote:
Easier way to do this, is when you save to your INI or to the REGISTRY,
don't save the name of the item, save the index number instead. When
you open the program again, pull that value from the ini or registry, and
then you can do just a simple list seek.

-Garrett


Well, on the page #1 I've actually given the code to show exactly how to do this. People where too busy slamming ini files to realize it though.

On the computer I've been using for 4 years I have 2.85 mb in *.ini files. I think that settles the "too much hard drive space" issue.

I do not use the registry when an ini file is more appropriate because I am open minded.

If other programs don't need access to the variable data then it should not be in the registry.

In case you didn't notice, most major programming companies such as Sun Microsystems think the same way.

Linux does not even have a registry.

Even Microsoft who claimed the registry would completely replace ini files still uses guess what? Ini files.

I have a little exercise for you, do a search on *.ini and see which of your installed programs uses ini files over registry. I think you'll be surprised.

By the way, @match() in this case is indeed a bad ideal.

NodNarb
Back to top
View user's profile Send private message AIM Address
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Thu May 15, 2003 9:50 pm    Post subject: Reply with quote

cnodnarb, just looking at your signature...

I sure hope it's gonne be out before september. I can't wait that long...

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Garrett
Moderator Team


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

PostPosted: Thu May 15, 2003 11:27 pm    Post subject: Reply with quote

Personally, I prefer using ini files over the registry. The registry is a
dangerous place to be and use. I've spent a lot of time learning about
the registry, playing in the registry, and totally messing up my system
from playing with the registry. So in the end, IMHO, using an ini is
far safer and easier to use. Plus, if something goes flaky with your
program and you need to solve it by just deleting it's settings, it's easier
getting the user to delete an ini file as opposed to having them open
regedit, and then trying to explain to them how to find your reg entries,
and then to chance having them delete the wrong entries.

BTW, on my system, I have 939 ini files for a total 3.35 megs. That's
with two versions of Windows on the system, and several hundred ini
files from my own programming. The registry files on my system
total up to 6.8 megs.

-Garrett
Back to top
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri May 16, 2003 7:28 am    Post subject: Reply with quote

OK, I've got the whole list working now. Except from one small detail.
If the user have never used the program before, there won't be any last engine in the registry.

So how can I select the first item in the list? I've tried %%temp = @item(1)
%%temp = @index(1) but it don't work.

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri May 16, 2003 7:37 am    Post subject: Reply with quote

Never mind.
Code:
  LIST SEEK,Engines,0
  %%temp = @index(Engines)

That seems to work.
But let me know if there is a better way to do that Wink

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon May 19, 2003 1:12 pm    Post subject: Reply with quote

cnodnarb wrote:

Well, on the page #1 I've actually given the code to show exactly how to do this. People where too busy slamming ini files to realize it though.

On the computer I've been using for 4 years I have 2.85 mb in *.ini files. I think that settles the "too much hard drive space" issue.

I do not use the registry when an ini file is more appropriate because I am open minded.

If other programs don't need access to the variable data then it should not be in the registry.

In case you didn't notice, most major programming companies such as Sun Microsystems think the same way.

Linux does not even have a registry.

Even Microsoft who claimed the registry would completely replace ini files still uses guess what? Ini files.

I have a little exercise for you, do a search on *.ini and see which of your installed programs uses ini files over registry. I think you'll be surprised.

By the way, @match() in this case is indeed a bad ideal.

NodNarb


Hi NodNarb,
No one was slamming you about using INI files. No one said that it was bad. I was just passing along information. If you want to use INI files then there is nothing wrong with that. It is personal preference. Also the only reason that Microsoft still uses INI files is to keep there software backwards compatible and like you said sometimes there is valid reasons to using INI files. Also eventhough your INI files are only showing 2.85 megs does not mean that you are actually using just 2.85 megs of resources when you access those files.
Anyone would have to agree that opening and closing multiple INI files from a harddrive takes more resources than opening one database and reading and writing records from ram.
Please NodNarb do not take this personal. I had no intention of bashing INI files or you. I was just pointing out some facts about the differences that all programmers should be aware of.
Here is another thought as well. If by chance anyone here builds a VDS application and wants to use the official MicroSoft Windows logos in their application and claim that it meets MicroSoft's guidelines and is certified then they will have to use the registry for keeping settings.

Again these are just some reasons why most programmers try not to use INI files if they can. Also as far as the Registry being dangerous well I know for a fact that the persons that are stating this have programs that do more than saving their application settings to the HKEY_LOCAL_MACHINE\Software key Wink Rolling Eyes hehehehehehehe

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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