• filesize(xx)

    From dream master@21:1/163 to All on Thursday, November 03, 2016 00:04:00
    so in pascal you can get the number of records by using filesi
    ze() but when itry it in mpl its not working. any ideas or
    work around? in mpl there issizeof() and filesize() tried wh
    at i could think of with no luck. .ú
    ùDream Masterùú.
    øùúùøøùúùø DoRE!AC
    iDiC!Demonic[dreamland.darkte
    ch.org]
    --- Mystic BBS v1.12 A31 (Windows)
    * Origin: |08--[|15!|07dreamland BBS dreamland.darktech.org (21:1/163)
  • From Pequito@21:1/126 to dream master on Thursday, November 03, 2016 04:38:00
    On 11/03/16, dream master said the following...

    so in pascal you can get the number of records by using filesize() but whe try it in mpl its not working. any ideas or work around? in mpl there is sizeof() and filesize() tried what i could think of with no luck.

    This is what I have used:

    Function ReadEntry(FN:String;I:Integer):Boolean
    Var Ret : Boolean = False
    Var Fp : File
    Begin
    fAssign(Fp,JustPath(ProgName)+FN,66)
    fReset(Fp)
    If IoResult = 0 Then Begin
    fSeek(Fp,(I-1)*SizeOf(Entry))
    If Not fEof(Fp) Then Begin
    fRead(Fp,Entry,SizeOf(Entry))
    Ret:=True
    End
    fClose(Fp)
    End
    ReadEntry := Ret
    End

    Function GetEntryCount:Integer
    Var Ret : Integer = 1
    Begin
    While ReadEntry(Ret+1) Do
    Ret:=Ret+1
    GetEntryCount := Ret
    End

    Cheers!
    Pequito

    |08+- |10$s.s$s.s$ |08------------------------------------+
    |08| |10$ý"$$$"ý$ |15tbbs.homeip.net |08|
    |08| |10 .$$$. winkle |02BB|10S |07tbbs.homeip.net:8080 |08|
    |08+--|10 .$$$$$. |08-------------------------------------+
    |10 $ý"~"ý$ |07Christopher Malo |15aka |07Pequito!

    --- Mystic BBS v1.12 A31 (Linux)
    * Origin: Twinkle BBS (21:1/126)
  • From Gryphon@21:1/120 to dream master on Friday, November 04, 2016 13:47:00
    On 11/03/16, dream master said the following...

    so in pascal you can get the number of records by using filesize() but whe try it in mpl its not working. any ideas or work around? in mpl there is sizeof() and filesize() tried what i could think of with no luck.

    In the mpltest.mps script, there's a procedure called 'testfileio'. In it it shows how to use the 'fsize()' function. Is that what you are looking for?

    "No matter where you go, there you are!" - Buckaroo Bonzai

    --- Mystic BBS v1.12 A31 (Raspberry Pi)
    * Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX (21:1/120)
  • From dream master@21:1/163 to Gryphon on Friday, November 04, 2016 19:50:00
    On 11/04/16, Gryphon said the following...
    In the mpltest.mps script, there's a procedure called 'testfileio'. In
    it it shows how to use the 'fsize()' function. Is that what you are looking for?

    if it will show me total record in a file yes. i will check it out thanks

    |08 .|05ú|13ù|15Dr|07e|08am Ma|07st|15er|13ù|05ú|08.
    |08 øù|05ú|13ùø |13øù|05ú|08ùø
    |11 DoRE|03!|11ACiDiC|03!|11Demonic |08[|15dreamland|09.|15darktech|09.|15org|08]

    --- Mystic BBS v1.12 A31 (Windows)
    * Origin: |08--[|15!|07dreamland BBS dreamland.darktech.org (21:1/163)
  • From dream master@21:1/163 to Gryphon on Saturday, November 05, 2016 01:54:00
    On 11/04/16, Gryphon said the following...
    so in pascal you can get the number of records by using filesize() bu try it in mpl its not working. any ideas or work around? in mpl ther sizeof() and filesize() tried what i could think of with no luck.
    In the mpltest.mps script, there's a procedure called 'testfileio'. In
    it it shows how to use the 'fsize()' function. Is that what you are looking for?

    just tried it and thats showing proper results. im gonna try peq way. i was doing this as a test to see how many records are in a file. like LoRD monster.dat there are 131 monsters and was looking to have it show me instead of going record by record

    |08 .|05ú|13ù|15Dr|07e|08am Ma|07st|15er|13ù|05ú|08.
    |08 øù|05ú|13ùø |13øù|05ú|08ùø
    |11 DoRE|03!|11ACiDiC|03!|11Demonic |08[|15dreamland|09.|15darktech|09.|15org|08]

    --- Mystic BBS v1.12 A31 (Windows)
    * Origin: |08--[|15!|07dreamland BBS dreamland.darktech.org (21:1/163)
  • From dream master@21:1/163 to Pequito on Saturday, November 05, 2016 02:01:00
    On 11/03/16, Pequito said the following...
    Function ReadEntry(FN:String;I:Integer):Boolean
    Var Ret : Boolean = False
    Var Fp : File

    tried your way but the function is saying ret+1 is type mismatch for here

    Function GetEntryCount:Integer
    Var Ret : Integer = 1
    Begin
    While ReadEntry(Ret+1) Do
    Ret:=Ret+1
    GetEntryCount := Ret
    End

    |08 .|05ú|13ù|15Dr|07e|08am Ma|07st|15er|13ù|05ú|08.
    |08 øù|05ú|13ùø |13øù|05ú|08ùø
    |11 DoRE|03!|11ACiDiC|03!|11Demonic |08[|15dreamland|09.|15darktech|09.|15org|08]

    --- Mystic BBS v1.12 A31 (Windows)
    * Origin: |08--[|15!|07dreamland BBS dreamland.darktech.org (21:1/163)