Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Urgent Help Required in VB6  (Read 3238 times)
SSL
Community Member
*
Posts: 20


« on: August 08, 2012, 12:58:23 PM »

Hello VB6 Programmers!

 Directly comming to the point,I need urgent help.

 I have a text file like this format

filename,type,scalex,scaley,scalez,posx,posy,posz,rotx,roty,rotz

now question is that I need to read them as
text1.text=filename
text2.text=scalex
etc.

I think you got because I cannot explain more clearly as am not english.

Please tell me how I can do that?
« Last Edit: August 08, 2012, 02:49:52 PM by SSL » Logged
beyonder
Moderator
Community Member
*****
Posts: 470


« Reply #1 on: August 08, 2012, 07:23:49 PM »

Learn text parsing I suppose.

Google is your friend.

I suggest you teach yourself basic programming before tackling a game.

Laters.

Logged

"And what I saw scared me to the depths of my miserable soul. It was true, it was all a sham, it ain't real." - The Thirteenth Floor
SSL
Community Member
*
Posts: 20


« Reply #2 on: August 08, 2012, 09:19:07 PM »

Thanks Man! I think 3 years are enough for learning basics but I can't say anything if someone is self-taught! Those dozen (or more!!) books I've read for these years, didn't contained any information about t.p.! well they told about Programming Concepts and other things.
« Last Edit: August 08, 2012, 09:30:38 PM by SSL » Logged
Qbasic8
Customers
Community Member
*****
Posts: 123

Nothing Is Funner Then DirectX Coding.


WWW
« Reply #3 on: August 08, 2012, 09:51:22 PM »

Very simple.  (assuming you have "filename,type,scalex,scaley,scalez,posx,posy,posz,rotx,roty,rotz" on one line in the file then just use the split command. I see you already have a "," so that helps.

Dim ReadValue as String
Open (FileName) For input as #1
     Line Input #1, ReadValue
Close #1


Dim TheData as variant
TheData = split(ReadValue,",")

Now you have an array with each item in it.

Text1.text = FileName would become: Text1.Text = TheData(0)
Text2.text = ScaleX would become: Text2.Text = TheData(1)
etc......

If you don't understand then just send a message and I will make a small example project for you.
Logged
SSL
Community Member
*
Posts: 20


« Reply #4 on: August 08, 2012, 10:38:14 PM »

thanks! I got it.

first I was using straight ini like

[Meshinfo]
filename=leiwulong
filetype=mdl
scalex= 0.7
.
.
.

 and then i thought it would be better using file like this:

[Section]
key1=blah1,blah2,...
Key2=b1,b2,...
.
.
.

Again thank you! It seems you are very good in VB(6?).
« Last Edit: August 08, 2012, 10:40:17 PM by SSL » Logged
GODDUEL
Customers
Community Member
*****
Posts: 21


« Reply #5 on: October 16, 2020, 10:07:30 AM »

Hola saludos
Usa el chilkat CKstringarray de Chilkat Software
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks