Joe Strazzere - All Things Quality

Visit my new blog at http://strazzere.blogspot.com/


May 12, 2010 - WinTask - CreateFile()

Posted in WinTask

 

 

'
' CreateFile - Create a file of arbitrary length
'
' Author: Joe Strazzere
'

 

Function CreateFile(location$, Length)
 Local MyStr$, Target, Main1000, Main100, Remain, Index


 MyStr$=""

 

Target = Length
Main1000 = Target / 1000
Main100 = (Target mod 1000) / 100
Remain = Target mod 100

 

Index = 0
While Index < Main1000
  MyStr$ = MyStr$ + "JSS.................................................................................................JSS.................................................................................................JSS.................................................................................................JSS.................................................................................................JSS.................................................................................................JSS.................................................................................................JSS.................................................................................................JSS.................................................................................................JSS.................................................................................................JSS................................................................................................."
  Index = Index + 1
Wend

 

Index = 0
While Index < Main100
  MyStr$ = MyStr$ + "JSS................................................................................................."
  Index = Index + 1
Wend

 

Index = 0
While Index < Remain
  MyStr$ = MyStr$ + "."
  Index = Index + 1
Wend

 

'MsgBox(Len(MyStr$))
Write(Location$,MyStr$)

EndFunction

 

CreateFile("c:joetest.txt",123456)

 




Any comments on this article?
Email Me


<- Last Page :: Next Page ->

About Me

A gathering place for information and ideas about Quality Assurance, Testing, and other useful topics.

Problems cannot be solved by the same level of thinking that created them. - A. Einstein

Search This Site

Translate This Site

RSS Feed

Subscribe

Twitter

@jstrazzere

Categories

Life
QA
Sports
Tools
WinTask
Work in General

What I'm Reading Now