Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


textdelimiter problem (Mike A... Stick with me...)

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,45828
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> textdelimiter problem (Mike A... Stick with me...)
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 textdelimiter problem (Mike A... Stick with me...) - 4/13/2007 4:06:59 AM   
  mikemedia

 

Posts: 4
Score: 0
Joined: 4/13/2007
Status: offline
Help me some more please. 

Enough dinking around.

Here's the script:

<style type="text/css">
<!--
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style>

<table width="300" border="0" cellspacing="3" cellpadding="0">
<tr>
  <td valign="top" class="style1"><p>&nbsp;</p>
  </td>
  <td valign="top">&nbsp;</td>
</tr>
<tr>
  <td valign="top">&nbsp;</td>
  <td valign="top">
<asp:label runat="server" id="lblsplittext" Font-Name="Verdana" />
<%@Import Namespace="System.IO"%>
<script language="vb" runat="server">
Sub page_load(Sender As Object,e As EventArgs)
Dim filetoread as string
filetoread=server.mappath("readtest.txt")
dim filestream as StreamReader
filestream = File.Opentext(filetoread)
Dim readcontents as String
readcontents = fileStream.ReadToEnd()
                                                                     ORIGINALLY
                                                                            Dim textdelimiter as String
  NOW                                                                      textdelimiter = ","

textdelimiter = CHR(9)                                    
Also tried
   textdelimiter = (CHR(9))
   textdelimiter = CHR(09)
   textdelimiter = CHR$(9)
Dim splitout = Split(readcontents,textdelimiter)
  dim i as integer
  for i=0 to Ubound(splitout)
lblsplittext.Text &= splitout(i)& "<br>"
  next
filestream.Close() 
End Sub
</script>
</td>
</tr>
</table>
<p>&nbsp;</p>
<p>
<%-- End of script--%>
</p>


//EDIT: changed title to reflect issue

< Message edited by Snipah -- 4/13/2007 4:33:54 PM >
 
 
Post #: 1
 
 RE: Mike A... Stick with me partner - 4/13/2007 4:15:10 AM   
  DiGiTAL.SkReAM


Posts: 1097
Score: 6
Joined: 9/6/2005
From: Florida, USA
Status: offline
If this is all of your code, then you are having soem pretty serious problems.
First off, in vbscript this line:

      

Doesn't work.  All variables are type Variant in vbscript.

      

is the proper way to Dim a variable.

Also, you use the "File" object, but I don't see you create it.

      
is the way to do it.

I suggest that you take a read through the docs listed in the frist post, as you are obivously a programmer, but just not familiar with the vbscript syntax and req's.


_____________________________

"There's the one man who learns by reading, the two men that learn by watching, and the rest of us have to pee on the electric fence for ourselves." - Roy Rogers

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

(in reply to mikemedia)
 
 
Post #: 2
 
 RE: Mike A... Stick with me partner - 4/13/2007 4:22:29 AM   
  mikemedia

 

Posts: 4
Score: 0
Joined: 4/13/2007
Status: offline
Mike,

You're right about me being unfamialr and the script be inelegant, but it DOES work with this...  

Dim textdelimiter as String
  textdelimiter = ","

Every coma delimited file formats perfectly.

It's just I can't interpret "TAB"

Sorry if I'm a pest!

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 3
 
 RE: Mike A... Stick with me partner - 4/13/2007 4:45:11 AM   
  dm_4ever


Posts: 2174
Score: 32
Joined: 6/29/2006
From: Orange County, California
Status: offline
Looking at this line: <script language="vb" runat="server">  it looks like you are using VB and not VBScript
Not sure about accomplishing this with VB, but have you trief vbTab?..maybe Dim it as a contant
Reference: http://msdn2.microsoft.com/en-us/library/f63200h0.aspx

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to mikemedia)
 
 
Post #: 4
 
 RE: Mike A... Stick with me partner - 4/13/2007 5:50:18 AM   
  mikeock


Posts: 124
Score: 1
Joined: 6/8/2006
Status: offline
Yeah are you tryign to run vb or vbscript?
I know vbs but not VB!

_____________________________

My sig sucks!

(in reply to mikemedia)
 
 
Post #: 5
 
 RE: Mike A... Stick with me partner - 4/13/2007 4:29:39 PM   
  Snipah


Posts: 1341
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
this is more ASP....

That should be in a different forum....

_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to dm_4ever)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> textdelimiter problem (Mike A... Stick with me...) Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts