🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #2221

VB-script niet in orde ?

#2221
From: Lucas
Date: Fri, 13 Aug 2004 07:37
39 lines
2032 bytes
Het onderstaand VB-scriptje zet een prijskolom van een Excel file om naar
dit formaat "00000000000.00"
(via data-pump in MySQL)
Maar bij de conversie blijkt dat sommige waarden met 1.00 verhoogd zijn. Dus
ik vermoed dat er ergens
een klein foutje zit in dit script. Omdat ik zelf niets afweet van VB, vraag
ik het daarom aan jullie.

Met vriendelijke groeten,

Lucas


**********************************************************************
'  Visual Basic Transformation Script
'  Copy each source column to the
'  destination column
'**********************************************************************
Function Main()
 Euro = DTSSource("F4")
 Zero="00000000000"
 Val=CInt(Euro)
 Resu=Cstr(Val)
' Resu=Cstr(Euro)
 Carac=Len(Resu)
 Comma=Int((Euro-Int( Euro ))*100)
 Nzer=11-Carac
 if Comma  >9  then Pab=Mid(Zero,1,Nzer) & Mid(Resu,1,Carac) & "."&Comma
else Pab=Mid(Zero,1,Nzer) & Mid(Resu,1,Carac) & "." & "0"&Comma
 DTSDestination("TCAPAB") = Pab
 Main = DTSTransformStat_OK
End Function



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.737 / Virus Database: 491 - Release Date: 11/08/2004
Technical Details
Message-ID: <411c6fd7$0$294$ba620e4c@news.skynet.be>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.wirehub.nl!skynet.be!newspost001!tjb!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: fcea4,12cd16535135d789,start
X-Google-Attributes: gidfcea4,public
X-Google-Language: DUTCH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.wirehub.nl!skynet.be!newspost001!tjb!not-for-mail
From: "Lucas" <luc.logghe@pandora.be>
Newsgroups: be.comp.programming
Subject: VB-script niet in orde ?
Date: Fri, 13 Aug 2004 09:37:28 +0200
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Lines: 41
Message-ID: <411c6fd7$0$294$ba620e4c@news.skynet.be>
Organization: -= Belgacom Usenet Service =-
NNTP-Posting-Host: 81.241.233.163
X-Trace: 1092382679 news.skynet.be 294 81.241.233.163:1179
X-Complaints-To: usenet-abuse@skynet.be