Hello Guest it is April 24, 2024, 07:12:01 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Ya-Nvr-No

621
I've used this one for years attached to a button.

Dim currentLine As String
Dim currentfile As String
Dim filesys, filetxt, lastline, oldline As String

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set filesys = CreateObject("Scripting.FileSystemObject")
currentLine = GetOEMDRO(816)
Found = False
currentfile = FileName
Set filetxt = filesys.OpenTextFile(currentfile, ForReading, True)

Dim i As Integer
i = 0

Do While filetxt.AtEndOfStream <> true
  linestring = UCase(filetxt.ReadLine()) & " "
  If linestring <> " " Then
    i = i+1
    If i > currentLine Then
      If ((InStr(linestring,"M6") >0 Or InStr(linestring,"M06")>0)) Then
        SetOEMDRO(816,i)
        Found = True
        MsgBox "File has been set to line:"& GetOEMDRO(816)&" Your next toolchange position.Your previous line was:"&currentLine
        Exit Do
      End If
    End If
   End If
Loop

If Found = False Then
  MsgBox "No M6/M06 Found after LINE:"& currentLine
End If

filetxt.Close
Set filesys = Nothing
Set filetxt = Nothing

622
'gives you the idea.


Do Until EOF(1)
  lFoundLine = lFoundLine + 1
  Line Input #1, sLine
  If InStr(1, sLine, "(") > 0 And lfoundline > GetDro(16)+1 Then
    flag=1
  End If
  If flag=0 Then
    If InStr(1, sLine, "T") > 0 And lfoundline > GetDro(16)+1 Then
      Exit Do
     End If
  End If
  flag=0
Loop



623
See... you can do it, you have been a machine at pumping out useful code. Just need to push your talents a little, always been fun for me to learn new things. I think your like that too.

624
Use a flag that when you see a "(" you set the flag to 1 keep searching until you see a")" reset the flag to 0. Than your back to looking for a "T"

625
Sorry I thought you lived in the northeast

Now that is unless you have messages with a 'T' in the comment.   ;)


626
Might want to add an alternative or "M6" search also.

You sure are working hard on your Florida winter retreat.
Have fun.

627
Machscreen Screen Designer / Re: User DRO (Counter)
« on: March 04, 2013, 04:56:51 PM »
Try a sleep after the SetUserDRO

sleep (1000) 'command is either in seconds or milliseconds depending on your defaults.
might be, it is blowing right thru the command and never get a screen updated.
  or you could try another while loop
sounds like your close. Never give up


628
Modbus / Re: Modbus Slave simulator
« on: March 03, 2013, 03:26:56 PM »
That's the same director that did Clockwork Orange. I loved that movie.

629
Modbus / Re: Modbus Slave simulator
« on: March 03, 2013, 03:24:06 PM »
I had no idea what you guys were talking about till I googled it:

"In Greek mythology Sisyphus was a king of Ephyra (now known as Corinth) punished for chronic deceitfulness by being compelled to roll an immense boulder."

You kids, have a toast and lets all get over any misunderstandings.

Sorry, I never ment for ill feelings to be unearthed. We are here to have fun first, and share knowledge or/and experiences.
Nothing should be taken personal. I'm too old to believe it is my way or the highway anymore. Don't really give a crap, I just do my thing and enjoy what time is left. And pity my family and the auctioneer when they have to sell off all this stuff. lol

630
Modbus / Re: Modbus Slave simulator
« on: March 03, 2013, 11:05:12 AM »
It was not anything more than, never seen that website before and thought it a cool & funny way to linked it.