Announcement

Collapse
No announcement yet.

CVMS CVMD MKMS$ MKMD$ read these files from .Net

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CVMS CVMD MKMS$ MKMD$ read these files from .Net

    CVMS CVMD MKMS$ MKMD$ read these files from .Net

    Hi !

    I am busy on a project (VB .Net) to read data files from my old PB programs and I can't seem to be able to read the numeric values from my random files.

    Does anyone have an idea as to how to read a record that has stored data using MKMD$ MKI$ MKMS$.

    How are these files converted and stored in PB, I know interger is 2 bits, cvms is 4 bits etc but what is behind the conversion . .


    Hope someone can assist

    Bye Now
    www.compubyte.co.za/dev.htm

    ------------------
    JustBASit

    -------------------
    www.compubyte.co.za
    ------------------- [email protected]
    JustBASit

    -------------------
    www.compubyte.co.za
    ------------------- [email protected]

  • #2
    Basit,
    check this link:
    DevX.com - MK? And CV? - Convert numbers to strings and back

    Bye!

    ------------------
    Try Online TrID file identifier! Recognize over 1.400 filetypes and counting...
    Give a powerfull scriptable Lua interface to your application with PowerBLua
    PBTracer - Tracer / Profiler for PowerBASIC (soon!)
    -- The universe tends toward maximum irony. Don't push it.

    File Extension Seeker - Metasearch engine for file extensions / file types
    Online TrID file identifier | TrIDLib - Identify thousands of file formats

    Comment


    • #3
      I can't see where there ought to be a problem. The binary numeric
      formats are perfectly standard. VB.Net ought to be able to handle
      them directly.

      ------------------
      Tom Hanlin, PowerBASIC Staff
      Opinions expressed may not be those of my employer or myself

      Comment


      • #4
        Thanks Marco ! Thanks Tom !

        Tom when you say "standard" and "directly" . . what do you exactly mean?

        If I were to read 4 bits of a string (These 4 bits represent CVmS/MKmS$ data written from PowerBasic)
        How would .Net interpret this string?

        I think the problem is that I really dont understand how PowerBasic converts
        the numeric value Eg:1000.99 into a four bit string, while I understand that the MKMS$ function does this in powerbasic how does it do this?? (ummm the code behind the function?)

        Thanks



        ------------------
        JustBASit

        -------------------
        www.compubyte.co.za
        ------------------- [email protected]
        JustBASit

        -------------------
        www.compubyte.co.za
        ------------------- [email protected]

        Comment


        • #5
          >CVMS CVMD MKMS$ MKMD$ read these files from .Net...
          >The binary numeric formats are perfectly standard. VB.Net ought to be able to handle them directly.

          I don't think so....

          The CVMS, CVMD an corresponding MKMS$ and MKMD$ functions convert to/from the Microsoft "MBF" format data, whereas most software created after 1990 uses IEEE format. PB/DOS goes back and forth between IEEE numeric and string with MKS$, MKD$, CVS and CVD (note no "M" in the function names).

          I think you'll need to convert from MBF to IEEE to use those data with anything.net

          MCM


          Michael Mattias
          Tal Systems Inc. (retired)
          Racine WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            CVMS and CVMD do not relate to standard numeric formats. They're used
            for converting from antiquated Microsoft formats. There's code in the
            libraries for dealing with them. See MSBF.zip here:

            http://www.powerbasic.com/files/pub/pbwin/misc/


            If you're dealing with normal binaries, though, the solution is just
            to input into an appropriate UDT (user-defined type) rather than a
            string. The results will convert automatically or, more exactly, are
            already in the correct state. That is, if a member of the type is
            SINGLE, and you're reading in a single-precision value, there's no
            conversion that needs to be made. A SINGLE is a SINGLE regardless of
            what produced it, unless you're going back to ancient Microsoft DOS
            compilers... in which case, you may need the MSBF conversion, above.

            PowerBASIC is also very flexible about putting strings into UDTs, or
            vice versa. See LSET, RSET, and CSET.

            Thank you for setting me up, Michael. Your serve, I believe.

            ------------------
            Tom Hanlin, PowerBASIC Staff
            Opinions expressed may not be those of my employer or myself

            Comment

            Working...
            X