Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Sleep Function Not Working Too Well


Hello, sleep is causing my system to freeze under the following circumstances
whereas sleep is defined as coming from the kernel32 dll

for i = 0 to 19
sleep 1000
msgbox i & " seconds have passed"
if i = 19 then
msgbox "time is up"
end if
next i

please keep in mind that i do not want to use the timer control for pausing the 1 second - i want to use sleep. any ideas? please respond to my email

jstic04@cp.centennialcollege.ca




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Sleep API Not Working
I am having problems with the Sleep API. It doesn't appear to pause at all, even if it is set for 65000. Has anyone else encountered this? I'm using it in Office automation. It's in a loop waiting for Word to close before processing continues. I tried it in debugging mode, no pause, and then compiled it and tried again. No pause. I know it has to be something simple that I'm missing. I copied the declare statement from another post.

Declare Sub Sleep Lib "kernal32.dll" (ByVal dwMilliseconds As Long)


tfProcessing = True
Do While tfProcessing = True
' DoEvents
Sleep 65000
nDocumentCount = WordApp.Windows.count
' Error 462 occurs when Word is closed
If Err.Number = 462 Then
tfProcessing = False
DoEvents
End If
Loop

Thanks.

Can I Use Sleep API Function In Thread Function
Hi all

i am trying to use sleep API function within the body of the thread functio, but i can't an error occur

for example

Private Sub Command1_Click()
hThread1 = CreateThread(ByVal 0&, ByVal 0&, AddressOf th1, ByVal 0&, ByVal 0&, hThreadID1)
End Sub

Public Sub th1()
While (True)
Form1.Label1.Caption = Val(Form1.Label1.Caption) + 1
Sleep(1000) ' the error occur when sleep function end
Wend
End Sub

also u must note that when i run the program from the VB its work probably, but when i make an EXE file and run it ... the errors occur

the error messege is:
The instruction at "0x6aaa7339" referenced memory at "0x0000009c". The memory could not be "written".
...

About The Sleep Function
Hi, I don't know how to work the sleep function, is it something I have to define, or is it an API, I'm lost, if someone could please help, thanks

Sleep Function?
Is there a sleep function (or timer) in VB? Our program is working too fast!

Thanks!

Sleep Function
Hey dear kind people reading this...

HELP!!!
I want to have a delay in my program
But it won't work with a timer
So, I know I need to use the sleep function
But I don't know how
Could someone please help with the code, and explain what's going on if possible
Thanks so much!!!

Sleep Function
Hi,
I am using the Sleep function from win32 lib and my application
freeze.

Obviously because it is used in a loop and I set the time
to 1 millisecond. In the same loop I call DoEvent Function.

The application uses the vbModless in order to show the
window in the taskbar.

The usage of this Mode and the Sleep event is because
the application is using 100% of the CPU

Any help here?

Thank you
Ziko

What Does 'sleep' Function Do?
With reference to my previous thread on copying USB drive



http://www.vbforums.com/showthread.php?t=503894


Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)


I was told that the 'sleep' function pauses the application for specified time interval. (May not necessarily give time to other processes to run simultaneously ).

Is it true?


So what is the difference between 'sleep' and this loop?


Code:
Dim date1 As Date
date1 = Now
While (DateDiff("s", date1, Now) < 5)
Wend



My main concern is to let my application give some breathing time to other processes while copying folders of several gig in size

Sleep Function In OCX
If i use the sleep function in an OCX will it effect the program that it is using, or will it just make the OCX sleep/

?

ILMV

Sleep Function
Does anyone know how to make a sleep function, I want to make a picture visible, then wait 1/2 a second then make it visible and so on and so on

Thanks

Is There A Sleep Function In Vb?
is there a sleep function in vb? where I can stop my code from running for about 5 seconds to wait for something else to finish.

this is from vb help, I need to wait for my batch file to finish before my code continues. I'm surprised there isn't a wait or sleep function, what am I missing?
Note By default, the Shell function runs other programs asynchronously. This means that a program started with Shell might not finish executing before the statements following the Shell function are executed.

Sleep Function?
is there a way to let the computer wait a little while ( i've got vb 6, learning edition)

in qbasic (yeah, i did a little of that too ) it was just " sleep 1 " or something like that...

How To Use Sleep Function In VB??
Hi
How to use Sleep Function In VB?? Any help on this?
thanks in advance
Karthik K

Sleep Function
does VB5/6 contain something like a 'sleep' function ? say i attempt to contact a remote server but at the time no connection can be made, and i'd like the code to try again after a wait of 15 minutes

i'm currently sending the errortrap to a timer with an interval of 60000 milliseconds where it loops 15 times, but that seems a rather clumsy way of doing things

Sleep Function ...
Hi Patrick,

Please you can give me an example of a sleep function ?

Thanks in advance
Abilio

Help Using The Sleep Function In VB6
HI All

Wonder if anyone can help. I am using the sleep function, but not sure why I am getting the follwoing error:

Compile Error: Sub or function not defined?

My code is:

Private Sub Form_Load()
Dim Counter As Integer

Call AddToTray(Me.Icon, Me.Caption, Me)

Counter = Counter + 1
Text1.Text = Counter

Sleep 2000

If Counter = 30 Then
Call StockUpdate
Counter = 0
End If

End Sub

Kindest Regards

Peter email@removed

Sleep Function
Hi,

I wanna make my program do nothing for 45 min. because my program should wait for another program to finish and it takes the other program about 45 min to be done.

Should i use CODEPrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Is Sleep Function Bad?
Hey there,
I was doing some reading on the sleep function, and some ppl seem to say it's not a good thing to use. I have a program that will load at the system startup, and i have Sleep set for 300 milliseconds. Is this ok?

Is There A Function Better Than API SLEEP?
I have read that from the internet that API sleep minimum delay is 10ms even though it is "sleep 1".

Is there a function that is almost like the API sleep but much more precise? Real 1millisecond delay?

I have seen some multimedia timer that is able to set the interval to 1ms and it really does. But I really need SLEEP function to do the job.

Thank you.

Sleep Function
When I use the sleep function like this:

WebBrowser1.Navigate "http://www.yahoo.com/index.html"
Sleep (5000)
WebBrowser1.Navigate "http://www.pcmarketfanatics.com/index.cfm"

It throws me an error like this:
"Compile Error: Sub or Function not defined"

Thanks,
Ben

Sleep Function Problem
Hey guys, nice to be here.

Can you please point out why this code doesnt work?

Private Sub Start_Button_Click()

Message_Box.Cls
Message_Box.FontSize = 12
Message_Box.ForeColor = vbBlue
Message_Box.Print "Wait for 10 seconds"
Sleep (10000) ' 10 seconds
Message_Box.Print "10 seconds have passed. Now you can continue"

End Sub

i'm aware that Sleep freezes the whole application but shouldnt it display the first message, then sleep for 10 seconds, and then display the second message? Because as soon as i hit the Start button, the program freezes without displaying the first message.

Any advice on how to make this work?


thanks in advance

Foundas

Get A Function To Sleep, Not Whole Program
First off, sorry if this is in wrong board, I didn't know where to put it. Anyways, I'm writing a program that streams video to a shoutcast server. I have it do it by sending a little bit, sleeping for a tenth of a second, then sending a little more, and it continues this. Doing just this, it works fine.

I'm trying to add other things to my program, which also involve doing things at a certain timing, but the Sleeps are interfering with each other.

I have each part broken into a function. Is there anyway that I can get just the function to pause and allowing other parts of the program to continues as usual? A little searching brought me to SleepEx, but it either is the wrong thing or I'm not using it right, as it does the same thing as Sleep.

TIA

Question About Sleep Function
i tried to use the vb sleep function described here , but i get the following error:
"Member already exists in a object module from which this object module derives"

here is my source:

Code:
Option Explicit
Private Declare Sub sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

Private Sub Command1_Click()
Dim User As String, Pass As String, PTries As Integer, UTries As Integer, tmp As String, Tries As Integer
Close #2
Open PList For Input As #2
Line Input #2, tmp
Line Input #2, tmp
Close #1
Open UList For Input As #1
Line Input #1, tmp
Line Input #1, tmp

For UTries = 0 To txtULines - 1
Line Input #1, User
CurrentUser = User
For PTries = 0 To txtPLines - 1
Line Input #2, Pass
CurrentPass = Pass
Inet1.Execute "http://" & Text1, "POST", Text4 & CurrentUser & Text2 & CurrentPass & Text3, "Referer: " & Text5 & vbCrLf & "Content-Type: application/x-www-form-urlencoded" & vbCrLf & "Accept-Language: en-us" & vbCrLf & "Accept-Encoding: gzip, deflate" & vbCrLf & "User-Agent: Mozilla/4.0 (compatiable; MSIE 6.0; Windows NT 5.1; yie6; .NET CLR 1.0.3705)"
lstData.AddItem (User & ":" & Pass)
Tries = Tries + 1
txtTries = Tries
sleep (sleep)
Next PTries
Close #2
Open PList For Input As #2
Line Input #2, tmp
Line Input #2, tmp
Next UTries
End Sub

Private Sub Command2_Click()
Dim UserLines As String, UTitle As String
CommonDialog1.Action = 1
UList = CommonDialog1.FileName
Open UList For Input As #1
Line Input #1, UTitle
Line Input #1, UserLines
txtUTitle = UTitle
txtULines = UserLines
End Sub

Private Sub Command3_Click()
Dim PassLines As String, PTitle As String
CommonDialog2.Action = 1
PList = CommonDialog2.FileName
Open PList For Input As #2
Line Input #2, PTitle
Line Input #2, PassLines
txtPTitle = PTitle
txtPLines = PassLines
End Sub

Private Sub Command4_Click()
Form2.Show
End Sub

Private Sub Form_Load()
On Error GoTo Err_Form_Load
CommonDialog1.InitDir = App.Path
CommonDialog1.Filter = "All Files (*.*)|*.*"
CommonDialog1.Flags = &H4&
CommonDialog2.InitDir = App.Path
CommonDialog2.Filter = "All Files (*.*)|*.*"
CommonDialog2.Flags = &H4&
Err_Form_Load:
End Sub
thx in advance
-Skeetch

Sleep Function In A Module?
Hi everyone,
I'm trying to write a function that uses the "Sleep" command, but when I call the function VB crashes (it stops responding)! My code looks like this:


Code:
Option Explicit

Declare Function Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Function Test()

Dim a As Integer

For a = 0 To 10
Sleep 1000
MsgBox ""
Next a

End Function


Please help me anyone!

Problem In Using Sleep Function In My Program
hi all,

i had 8 set of pic. one appear after another. initially, my program is as follows:

Delay 1
Picture2.Left = Picture2.Left + f * 1 / 8
Picture3.Visible = False
Picture4.Visible = False
Picture5.Visible = False
Picture6.Visible = False
Picture7.Visible = False
Picture8.Visible = False
Picture9.Visible = False

Delay 1

Picture2.Visible = False
Picture3.Visible = True
Picture3.Left = Picture3.Left + f * 2 / 8


Public Sub Delay(HowLong As Integer)
TempTime = DateAdd("s", HowLong, Now)
While TempTime > Now
DoEvents 'Allows windows to handle other stuff
Wend
End Sub


i find that the delay is too slow and i change it to sleep function and i get the result as attached. what should i do to solve the problem? thanks.

Pause, Wait, Or Sleep Function?
Does anyone know of a function that works in VB for apps (Excel) that provides a simple one-line way to wait for a couple of seconds? The only one I can find is the application.wait method which is awkward because it uses absolute time instead of just like wait 2 seconds.

Can I Use 'sleep' Function By Kernel On Other Processes, And Not My App?
hello,

can I use 'sleep' function by kernel on other processes, and not my app?
so that they will sleep and be on hold?

thanks

Sleep Function Tthat Allows Events ?
I know about sleep , but there is better sleep function i thikn its sleepex, anybody got an example ?

What Is Equivalent Function Of C++ Delay()/sleep() In VB
hi

    in C++ we have two functions sleep and delay. which will stops or waits for some time .

in vb also i want same things , how can i have like this.

thanks
---------------------------------------------
Srinivas.

Threading Fails With Sleep Function In
the module that has the code.

Gurus,
Here is the situation, I have the following code in module. I have a form that has a button. On clicking this button, i create a thread using createthread() api to execute the thread. when I am in IDE/Debug mode, the program does not give an error. But when I make it an exe and run the exe, the program aborts with "The instruction at 'xxxxxxxxxxxxxx' referenced memory at '0x0000009c'. the memory could not be 'written'.

But when I comment the sleep statement , the make an exe and run the exe, it works fine.

Is there anyway to solve this issue.

Thanks, I appreciate your help

<b>
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

and try to multi-thread the following function, I get an access violation.

Public Function addtext()

i = 0
'Do

While i = 0
Sleep (1)
If i > 0 Then
Form1.Text1.SelText = "i > 0 "
End If
Form1.Text1.SelText = "adding to textbox "
Wend
'Loop

End Function
</b>

Making A Function Take Longer To Execute (sleep ?? ))
Hi
I need to make a function take longer to execute, but not by inserting loops and so, perhaps a function that delays the execution of instructions.
I need this because I need to use an object with php and php unloads the object just after the function returns anything.
Or perhaps I could return the value of a function from an other (very unlikely to me)?
Thanks!

Lookin For A Sleep Function Or Some Type Of Delay Which Doesn&#039;t Use System Resources.
Hey there guru's is anyone aware of a sleep/delay function that will not use system resources like a timer will.


Thank ya all in advance.

Sleep Little Thread, Sleep
Hi out there.

I'm getting stupid! I created a new thread. The thread calls a function which sets a textbox on a form to current time. Works well but my cpu is running 100%. No question cause there is a do ... loop with text1 = time$ inside. Going forward i inserted a sleep(500) into the loop. Guess what happened? The app crashed. Now tell my why. I tried everything. Any ideas?

Public Function threadDO()
Do
Sleep 500
Form1.text1 = time$
Loop
End Function

Yours

buzz

Why Isn't This Function Working?
Ok So I wrote this function to Display a timer counting down...
* Not the Timer Control A Timer Function
Its not throwing any erros (Hopefully I'd be able to use a function I wrote )
And When I step through it it displays the correct info when i put my mouse over it.
When I use it for a mulipaneled statusbar it works!

Code:
Private Sub Command1_Click()
WaitFor 5000, StatusBar7
End Sub

Public Function WaitFor(ByVal intSeconds As Integer, _
ByRef cntControl As StatusBar, _
Optional ByVal intPanel As Integer)

For intSeconds = intSeconds To 0 Step -1000
If intPanel <> 0 Then
cntControl.Panels(intPanel).Text = "Timer: " & intSeconds
Else
cntControl.SimpleText = "Timer: " & CStr(intSeconds) 'Not Updating Statusbar to display info!
End If
SecondsToWait 1000
Next
End Function

Function Not Working Too Well
Hello, here is my code

Form Load()
msgbox isbusy
End Function

Public Function isbusy() As Boolean
Dim cnt As Integer

For cnt = 0 To 255

If GetAsyncKeyState(cnt) <> 0 Then
isbusy = True
MsgBox Chr$(cnt)
Else
isbusy = False
End If
Next cnt

End Function


As you can see, this function checks to see if a key is being pressed. While I am pressing a key and run this program, the function outputs the key, but the call prints out "False" when it should be "True." When i am not pressing a key, it prints "False" like it is expected to. Any ideas?

Mid Function Not Working??
Hi,
I have just reinstalled windows after a hdd format.
I have my project all running again except for one little glitch.

I have the lines

Private Sub Combofemales_Change()
TextBox(6) = Mid(Combofemales, InStr(Combofemales, "[") + 1, InStr(Combofemales, "]") - InStr(Combofemales, "[") - 1)
End Sub

Private Sub Combomales_Change()
TextBox(5) = Mid(Combomales, InStr(Combomales, "[") + 1, InStr(Combomales, "]") - InStr(Combomales, "[") - 1)
End Sub

The programe stops on a full compile at the first "TextBox(6) = Mid" and highlights the string mid in BLUEand tells me
"Cannot find project or library"

Can anyone suggest what ive missed.
Many thanks
L

Mid Function Not Working!!
Hello,

I have this code given to me by I think it was MartinLiss, or somebody, it worked the first day they gave it to me, now it does not work? Anybody know why??



VB Code:
For i = 1 To StringLenIf Mid(phrase, i, 1) = letter Then     MsgBox "There is an " & letter & "!"                               Exit ForEnd If

Mid$ Function Not Working
Can someone tell me what is wrong with this code. When I try to run it there is a run time error 5 "invalid call, function"...


VB Code:
strB = "----------------------------------------" txtAmajSpc.Text = intAmajSpc        lngPos = Val(intAmajSpc)        lngPos = lngPos        strFretNumb = "2"        strB = Left$(strB, lngPos - 1) & strFretNumb & Mid$(strB, lngPos + 1)


txtAmajSpc is a textbox on form where user inputs a number

Anyone know what's wrong?!

DLL Function Not Working
Does anyone know why the function below will work when it is included in my project but if I put it in a DLL and I call the function it gives me a an error: "Object variable or with block variable not set." I am pretty sure it gives me the error for trying to set the ConnectionString, but why would it be an error? I set the Variable to new and I also include ADO in both the DLL and my project. I tried setting the connection to a new connection on a separate line and it still gives me an error.



VB Code:
Public Function AccountCode(ByVal sCust As String, _    ByVal sClass As String, _    ByVal sUsedFlag As String, _    ByVal sAccountCode As String, _    ByVal sConnectString As String) As String        Dim sSQL As String    Dim rsAccountCode As New ADODB.Recordset    Dim Connection As New ADODB.Connection    Dim sModifiedCode As String        On Error GoTo ErrHandler        Connection.ConnectionString = sConnectString    Connection.Open        rsAccountCode.ActiveConnection = Connection        Select Case sCust        Case "JL"            sSQL = "SELECT * FROM JLAccountCodes WHERE [Account Code] = '" & sAccountCode _                & "' AND [Class] = '" & sClass & "'"                        rsAccountCode.LockType = adLockReadOnly            rsAccountCode.CursorType = adOpenStatic            rsAccountCode.Source = sSQL            rsAccountCode.Open    End Select        AccountCode = rsAccountCode("Modified Account Code")        rsAccountCode.Close    Set rsAccountCode = Nothing    Connection.Close    Set Connection = Nothing    ErrHandler:    If Err.Number <> 0 Then        MsgBox Err.Description, vbOKOnly, Err.Number & " AccountCodeDLL"        Resume Next    End IfEnd Function

Str Function Not Working ???
I am using one variant type argument in a function. passing numeric value to it. and trying to add it in a string. e.g. eno is the argument and value of it is 111 now I have written
"select * from emp where empno = " + eno
but type mismatch error occurs. I tried for str(eno) but all sudden str is not working. what can be the reason and solution ???

Function Not Working?
Hi

This is hard for me to explain so bear with me

I am working on a calendar. I am working on a mousemove event for cmdday()

this will propogate special day information to txtDayEvent ie holidays.

Oh well enough explination the is the code that doesn't seem to work any suggestions?

Code:Private Sub ProcessButtonMouseMovecmd(index As Integer)
Dim i%
Dim mm%
mm = Month(lblmonth.Caption)

 Select Case cmdDay(index) 'refering to the arrays index
      Case 1
      If mm = 1 Then
      txtDayTitle.Text = "Martian Luther King Day!!"
      End If
end select
and the button code

Code:Private Sub cmdDay_MouseMove(index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
ProcessButtonMouseMovecmd cmdDay(index).index
End Sub

Thanks Natdrip

"I'm not a Nerd, I just prefer Dating invisible women"

Format Function Not Working
I have developed a simple program which is working fine on my pc but when i install it on another pc the format function does not seem to be working. An input box comes up 'Enter parameter value' Format
I have checked the file msvbvm60.dll is in the system32 folder and registered it manually by regsvr32 "c:winntsystem32msvbvm60.dll" and it said it was successful but format function still not working.

this is my code
If Me.txtDateTo = "" Then
sCriteria = "[RptDate] = #" & Format(Me.txtDateFrom, "mm/dd/yyyy") & "# and [Dept]='" & Me.Combo1 & "'"
Else
sCriteria = "[RptDate] between #" & Format(Me.txtDateFrom, "mm/dd/yyyy") & "# and #" & Format(Me.txtDateTo, "mm/dd/yyyy") & "# and [Dept]='" & Me.Combo1 & "'"
End If

what else do i need to do????

Custom Function Not Working
I have a custom function written in VB--a fairly simple one--and it's returning #VALUE!. I've worked out the formula by hand, and it should work. I'm not very familiar with VB code and excel--have I done something wrong? (Attached is the file). Thanks!

Query Function Not Working
I have this code in a VB project, (NOT VBA)


Code:
With agent
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "data source=c:alarmFilmRentals2.mdb"
.Open
End With

orgchart.Open "SELECT Orgchart.Name FROM orgchart WHERE ((FindString([Name], 'Yach')=True));", agent, adOpenStatic, adLockOptimistic


Debug.Print orgchart.RecordCount

it gives me error, "Undefined Function in 'FindString' in expression" even though i have the function well defined in both the database and the VB project (in a module)

help?

Triming Function Not Working
this function is supposed to take any html and remove all of the tags

for ex

Code:
htmlpage = trimAlltags(htmlpage, "<", ">")

htmlpage= "<h1><span pageTemplate_Default_Element1_lblHeading" Copy_Titles_Large_Bold">Prices</span></h1>"

or try this

htmlpage="<span pageTemplate_Default_Element1_lblCopyShort" Copy_Sub">Don't pay too much! </span>"

it works but does not trim all the tags in the source

any ideas?

i think i might have screwed it up with the
If mStartPos = 0 Then GoTo Done



but if i remove that then
mEndPos = InStr(mStartPos, LCase(SourceTxt), LCase(endTag))
gives me a runtime error 5






Code:
Function trimAlltags(SourceTxt As String, beginTag As String, endTag As String) As String

Dim mString As String
Dim mStartPos As Long, mEndPos As Long


mStartPos = InStr(1, LCase(SourceTxt), LCase(beginTag))
'# of the begin
mEndPos = InStr(mStartPos, LCase(SourceTxt), LCase(endTag))
'# of the end
'find the 1st end of the string
'look at the things in brackets and delete them loop
Do While mStartPos <> 0 And mEndPos <> 0 And mEndPos > mStartPos
mString = Mid(SourceTxt, mStartPos, ((mEndPos - mStartPos)) + Len(endTag))
MsgBox "trimming this= " & mString & " from " & SourceTxt
SourceTxt = Replace(SourceTxt, mString, "")
MsgBox "sourcetxt became " & SourceTxt
mStartPos = InStr(mEndPos, LCase(SourceTxt), LCase(beginTag))
If mStartPos = 0 Then GoTo Done
mEndPos = InStr(mStartPos, LCase(SourceTxt), LCase(endTag))

'mStartPos = InStr(1, SourceTxt, beginTag)
'mEndPos = InStr(mStartPos, SourceTxt, endTag)

Loop
Done:
trimAlltags = SourceTxt

End Function

Left() Function Not Working
Hi!

I have written a program that WAS working just fine but for some reason now bombs when I try to complie it.

Here is a section of my code...


Code:
Do While Not openFile.AtEndOfStream 'Do until the end of the file is reached
strLine = openFile.ReadLine
If InStr(1, strLine, "Part Name : ", vbTextCompare) Then
sTemp = Replace(strLine, "Part Name : ", "")
pos = InStr(1, sTemp, ":", vbTextCompare)
sDescription = Left(sTemp, pos - 1)
sTemp = Replace(sTemp, sDescription & ":", "")
pos = InStr(1, sTemp, ";", vbTextCompare)
sPN = Left(sTemp, pos - 1)
sTemp = Replace(sTemp, sPN & ";", "")
sVersion = sTemp

'Read the next line
strLine = openFile.ReadLine

If InStr(1, strLine, "Project/Catalog: ", vbTextCompare) Then
sTemp = Replace(strLine, "Project/Catalog: ", "")
pos = InStr(1, sTemp, ":", vbTextCompare)
sProject = Trim(Left(sTemp, pos - 1))
sTemp = Replace(sTemp, sProject & " :", "")
sLibrary = Trim(sTemp)

End If
If sDescription = "" Then
sDescription = "*"
End If
If sPN = "" Then
sPN = "*"
End If

prt.Add sDescription, sPN, "", sVersion, "", "", sProject, sLibrary


End If
Loop
Set PartList = prt.Parts

Exit Function
The problem is that the Left function is not recognized. If I comment the Left function line out the program will compile. All of the other similar functions like mid, right, and instr work fine. It appears to be a missing reference of some kind but Im not sure which one it is.

Any ideas would be great!

Thanks!

Private Function Not Working
I got this function which when the form starts up, it recreates lines to spit up a canvas into squares. Then I reuse it to clear the lines and redraw them when there canvas is resize, but it keeps on getting an error saying object already loaded

Thanks in advance

Kaluriel




Code:
Private Function BliteLines()
If Line1.Count > 1 Then
i = 1
Do While i <= Line1.Count
Unload Line1(i)
i = i + 1
Loop
End If

Line1(0).X1 = 32
Line1(0).X1 = 32
Line1(0).Y1 = 0
Line1(0).Y2 = Picture1.ScaleWidth

a = (Picture1.ScaleHeight 32)
b = (Picture1.ScaleWidth 32)

c = Line1.Count
Do While c <= a
Load Line1(Line1.Count)
Line1(c).X1 = 0
Line1(c).X2 = Picture1.ScaleWidth
Line1(c).Y1 = (c * 32)
Line1(c).Y2 = (c * 32)
Line1(c).Visible = True
c = c + 1
Loop

d = 1
Do While d <= b
Load Line1(Line1.Count)
Line1(c).X1 = (d * 32)
Line1(c).X2 = (d * 32)
Line1(c).Y1 = 0
Line1(c).Y2 = Picture1.ScaleHeight
Line1(c).Visible = True
d = d + 1
c = c + 1
Loop
End Function

Edit: JDT switched tags

Format() Function Not Working At All
I've recently returned to VB6 and am having an issue with the Format() function. I wrote a program years ago and it worked correctly then. When I try to run it now it gives me that compile error "can't find library" at all the Format functions.

An example of how I'm using it is like so:
string = "C: " + Format(getHDUsed, "###,.00") + " GB"

I'm thinking that I'm missing some kind of add-in or library but I don't know which is associated with the Format function. Nor do I even remember how to install add-ins or libraries. If anyone could help me with this, it would be much appreciated.

Function Not Working When Using Other Computer
as the title states,

i'm creating a database system. everything worked fine when using my computer but, when tested with other computers, deleting records doesn't work..

anyone know what's the cause of this?

Sendkey Function Seems To Not Be Working
VB Code:
Option Explicit Private Sub command1_Click()Timer1.Enabled = TrueEnd Sub Private Sub Timer1_Timer()Dim i as integerFor i = 0 To txttimes.TextSendKeys tmrtext.Text & Chr$(13)Next itmrTime.Enabled = FalseLabel1.Caption = "Times Spammed: " & i = i + 1End Sub


Someone tell me what wrongs please. And btw it ain't erroring?

Copyright © 2005-08 www.BigResource.com, All rights reserved