Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Not even sure if this is possible with VB

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Not even sure if this is possible with VB
  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 >>
 Not even sure if this is possible with VB - 7/6/2007 8:02:47 AM   
  chrisgoforth

 

Posts: 8
Score: 0
Joined: 7/6/2007
Status: offline
I need to take data that is input from a meg card reader, change the data by taking out some information and adding other information to it and then have it be put into another program. I dont mind coding this but I am VERY new to VB and am not even sure where to begin or if this is even possible. The script (if it is possible) will need be active either in the background or have a very friendly user interface as this will be running on a kiosk for our customers to access. 
 
 
Post #: 1
 
 RE: Not even sure if this is possible with VB - 7/6/2007 11:05:23 AM   
  Fredledingue


Posts: 383
Score: 0
Joined: 5/9/2005
From:
Status: offline
It's possible only if the datas are in text format (readable in notepad for example) and not located in memory (must be accessible from a drive).
Once you have text-based datas, you can do whatever you want with them.

For a cool, flashy interface, look at HTA scripting. HTA is HTML based interface for VBs and Js.
It's relatively easy.


_____________________________

Fred

(in reply to chrisgoforth)
 
 
Post #: 2
 
 RE: Not even sure if this is possible with VB - 7/6/2007 1:04:46 PM   
  chrisgoforth

 

Posts: 8
Score: 0
Joined: 7/6/2007
Status: offline
This is the data that I am getting from the swipe %1391000100005?;390100005?
It needs to be 3900100005. So basically it needs to read track 2 of the swipe and add a 0 after the first 2 numbers. The swipe acts just like a keyboard would so it would not be locked in memory.
The basic flow is Customer walkes up and swipes their card into an interface the interface then removes the %1391000100005?; and the trailing ? and adds a 0 after the 39. Once that is done it sends the recompiled 39001000 to another application

(in reply to chrisgoforth)
 
 
Post #: 3
 
 RE: Not even sure if this is possible with VB - 7/7/2007 4:25:03 AM   
  sheepz


Posts: 247
Score: 2
Joined: 3/17/2006
From: Riverside the 909s
Status: offline
i'm not great with vbs but heres something to work with... also i'm not sure how to add the extra 0 to the string, hopefully another person can help...

strSwipe = "%1391000100005?;390100005?"
arrSplit = Split(strSwipe, ";")
strResult = RTrim(Replace(arrSplit(1), "?", ""))
MsgBox strResult

also not sure if theres a function that will just remove the ? from the string... something like

strResult = RTrim(arrSplit(1), -1)   'this will not work, not sure how to remove last character from a string

(in reply to chrisgoforth)
 
 
Post #: 4
 
 RE: Not even sure if this is possible with VB - 7/7/2007 5:11:30 AM   
  Fredledingue


Posts: 383
Score: 0
Joined: 5/9/2005
From:
Status: offline
What a "swipe" is? And how do you get/read it?

_____________________________

Fred

(in reply to sheepz)
 
 
Post #: 5
 
 RE: Not even sure if this is possible with VB - 7/7/2007 5:52:15 AM   
  chrisgoforth

 

Posts: 8
Score: 0
Joined: 7/6/2007
Status: offline
It is a magnetic card reader made by MagTek and it acts just like a keyboard input

(in reply to chrisgoforth)
 
 
Post #: 6
 
 RE: Not even sure if this is possible with VB - 7/7/2007 8:17:17 AM   
  DiGiTAL.SkReAM


Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
quote:

ORIGINAL: sheepz

i'm not great with vbs but heres something to work with... also i'm not sure how to add the extra 0 to the string, hopefully another person can help...

strSwipe = "%1391000100005?;390100005?"
arrSplit = Split(strSwipe, ";")
strResult = RTrim(Replace(arrSplit(1), "?", ""))
MsgBox strResult

also not sure if theres a function that will just remove the ? from the string... something like

strResult = RTrim(arrSplit(1), -1)   'this will not work, not sure how to remove last character from a string


I wrote my own functions that I use a LOT to do stuff just like that:

http://www.visualbasicscript.com/fb.aspx?m=49139



_____________________________

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

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to sheepz)
 
 
Post #: 7
 
 RE: Not even sure if this is possible with VB - 7/7/2007 10:32:34 AM   
  sheepz


Posts: 247
Score: 2
Joined: 3/17/2006
From: Riverside the 909s
Status: offline
Digital, nice functions... i know this might be a ridiculous question then but there really isn't a Lstrip() or Rstrip() function within vbs?  theres no easy way to TRIM the string?

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 8
 
 RE: Not even sure if this is possible with VB - 7/7/2007 2:28:32 PM   
  DiGiTAL.SkReAM


Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Nope, the closest thing in native VB is LTrim, RTrim, and Trim
In Vb as well as all the derivations of it (VBA, VBS, etc.), the functions LTrim, RTrim, and Trim only trim off the whitespace to the left, right, or both ends of a string.
For example:

      
Notice where the spaces have been removed?

But, since these functions only remove the whitespace, they won't remove any characters OTHER than whitespace.  Hence the need for the functions I showed you.


_____________________________

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

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to sheepz)
 
 
Post #: 9
 
 RE: Not even sure if this is possible with VB - 7/7/2007 3:27:54 PM   
  sheepz


Posts: 247
Score: 2
Joined: 3/17/2006
From: Riverside the 909s
Status: offline
ahhh thanks, those functions already come in handy, thank you very much!  

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 10
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Not even sure if this is possible with VB 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