Results 1 to 11 of 11

Thread: Script engines tutorial

  1. #1

    Thread Starter
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Script engines tutorial

    Hi all,

    I started working on a script engines tutorial, I'm sure some of you will appreciate it ^_^

    Fox

  2. #2
    Frenzied Member
    Join Date
    Jun 2000
    Location
    England, Buckingham
    Posts
    1,341
    I will.....

  3. #3
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Sorry, but it doesn't work

    It says something about an internal server error...
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  4. #4
    Zaei
    Guest
    Works fine for me, although there isnt much there as of yet =).

    Z.

  5. #5
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    *miscellaneous praise*
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  6. #6

    Thread Starter
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Jotaf: This happens often to me when surfing, just press 'reload'...

    Zaei: I'm working on it... < Step 5.2 is alread up
    Last edited by Fox; May 28th, 2001 at 02:47 AM.

  7. #7
    Member Stef's Avatar
    Join Date
    May 2001
    Posts
    41
    I noticed this in your code...
    ' Split Temp, Data(A), "=" 'For VB5 users
    But I couldn't find the Split() function anywhere... After searching the msdn, I found the following code, which could be helpful to other vb5 users. Just copy/paste into a module...

    Code:
          Option Explicit
    
          Public Function Join(source() As String, Optional _
                sDelim As String = " ") As String
          Dim sOut As String, iC As Integer
          On Error GoTo errh:
              For iC = LBound(source) To UBound(source) - 1
                  sOut = sOut & source(iC) & sDelim
              Next
              sOut = sOut & source(iC)
              Join = sOut
              Exit Function
          errh:
              Err.Raise Err.Number
          End Function
    
          Public Function Split(ByVal sIn As String, Optional sDelim As _
                String, Optional nLimit As Long = -1, Optional bCompare As _
                 VbCompareMethod = vbBinaryCompare) As Variant
              Dim sRead As String, sOut() As String, nC As Integer
              If sDelim = "" Then
                  Split = sIn
              End If
              sRead = ReadUntil(sIn, sDelim, bCompare)
              Do
                  ReDim Preserve sOut(nC)
                  sOut(nC) = sRead
                  nC = nC + 1
                  If nLimit <> -1 And nC >= nLimit Then Exit Do
                  sRead = ReadUntil(sIn, sDelim)
              Loop While sRead <> ""
              ReDim Preserve sOut(nC)
              sOut(nC) = sIn
              Split = sOut
          End Function
    
          Public Function ReadUntil(ByRef sIn As String, _
                sDelim As String, Optional bCompare As VbCompareMethod _
              = vbBinaryCompare) As String
              Dim nPos As String
              nPos = InStr(1, sIn, sDelim, bCompare)
              If nPos > 0 Then
                  ReadUntil = Left(sIn, nPos - 1)
                  sIn = Mid(sIn, nPos + Len(sDelim))
              End If
          End Function
    
          Public Function StrReverse(ByVal sIn As String) As String
              Dim nC As Integer, sOut As String
              For nC = Len(sIn) To 1 Step -1
              sOut = sOut & Mid(sIn, nC, 1)
              Next
              StrReverse = sOut
          End Function
    
          Public Function InStrRev(ByVal sIn As String, sFind As String, _
           Optional nStart As Long = 1, Optional bCompare As _
                VbCompareMethod = vbBinaryCompare) As Long
              Dim nPos As Long
              sIn = StrReverse(sIn)
              sFind = StrReverse(sFind)
              nPos = InStr(nStart, sIn, sFind, bCompare)
              If nPos = 0 Then
                  InStrRev = 0
              Else
                  InStrRev = Len(sIn) - nPos - Len(sFind) + 2
              End If
          End Function
    
          Public Function Replace(sIn As String, sFind As String, _
                sReplace As String, Optional nStart As Long = 1, _
                Optional nCount As Long = -1, Optional bCompare As _
                VbCompareMethod = vbBinaryCompare) As String
    
              Dim nC As Long, nPos As Integer, sOut As String
              sOut = sIn
              nPos = InStr(nStart, sOut, sFind, bCompare)
              If nPos = 0 Then GoTo EndFn:
              Do
                  nC = nC + 1
                  sOut = Left(sOut, nPos - 1) & sReplace & _
                     Mid(sOut, nPos + Len(sFind))
                  If nCount <> -1 And nC >= nCount Then Exit Do
                  nPos = InStr(nStart, sOut, sFind, bCompare)
              Loop While nPos > 0
          EndFn:
              Replace = sOut
          End Function

  8. #8

    Thread Starter
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    There's a bold line "VB5 users click here" which show you a site with the Split() function for VB5 useres *grmbl*

  9. #9
    Member Stef's Avatar
    Join Date
    May 2001
    Posts
    41
    oh, hehe didn't see that...
    Anyway, the msdn-version of the function works just like the vb6 one, so you won't need to change the code.

  10. #10

    Thread Starter
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Well I personally like my function better

    But you're right, think I'll steal that code from msdn.. thx

  11. #11
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Yeah it works now, I tried reloading it but it didn't work at that time
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width