No announcement yet.

C (vb) to PB conversions

  • Filter
  • Time
  • Show
Clear All
new posts

  • C (vb) to PB conversions

    While reading through some recent messages of the BBS I noticed that some PB starters have a lot of problems to find the real power in PB.

    I think that a lot of pb starters come from the vb world (like me) and most of the time don't have any c knowledge.

    Wouldn't it be usefull if pb support created some documentation about the conversion rules between the different programming languages to pb ? It would be very usefull, because converting c (or vb) to pb would go much faster and people will learn variable sizes and programming in pb, quicker.
    It would also make the step from vb (c) to pb (more c style) smaller.


  • #2
    Using myself very often C examples from the MSDN CD-ROM.
    I do like your suggestion.
    It is sometime very hard to translate C to PB when you don't have a deep knowledge of it, reading C source code has never been a pleasure for me.
    Also a nice C to PB converter could be a very usefull utility, just a thought for a new third party addon
    And what about a PB to C converter

    Patrice Terrier
    mailto[email protected][email protected]</A>

    [This message has been edited by Patrice Terrier (edited June 11, 2000).]
    Patrice Terrier
    Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).


    • #3
      Disclaimer... the following is not representative of PowerBASIC, Inc or the views of management, etc. It is a sarcastic and cynical view on life, brought on because I am in pain after "minor" surgery (the doctor called it minor, I'd call it MAJOR!).

      Folks, here is the challenge...

      Write complete guidelines on converting from [insert language name] to PowerBASIC.

      If the folks going to be writing the stuff are not familiar with the language to the nth-degree, then send them on training courses and pay for them and the salary while that become guru's in a competitors language.

      Once trained, fully document translating code from the other language to PowerBASIC and don't leave even the smallest detail out! If there are several ways to do it, document every single one. If there have been a dozen different versions of that language, make sure every one of them is covered or someone will complain about the lack of documentation).

      The documentation has to be clear, concise and available in multiple international languages.

      Once it's all documented, write a program that can use the "rules" the documantation has established, and be able to take every possible style and variation of source code known to man in this other language and produce compilable PowerBASIC source code. Don't forget that this conversion has to be fast too, or no one will want it.

      If it is converting GUI code, the conversion application must be able to produce 3 different code outputs: An SDK-app, a dialog based app, and a DDT based app.

      Next, we want you to make this information and the program available to everyone for free. Yes, free, or everyone will moan.

      Oh yes, you have to pay the people who write, proof, bug test, document, reproof, retest, finalize, prepare copy, print, distribute, inventory, update, etc. No, the customers don't want to know about who the people are that do these tasks, or why they want to be paid for doing it.

      Note, if you make an error, you have to give every customer a free update.

      If you do issue an update, dont forget to tell everyone exactly what the differences between the last version and the update are. Don't leave out any details whatsoever, so someone will complain, and you'll have to redo the update process all over again.

      Next, start this process over again, but insert a different language name into the 1st paragraph of instructions herein.

      Keep going until all possible languages are covered. When finished, start again from the beginning on the maintanence cycle as each of these languages is updated.

      Somewhere in there, see if you can find time to knock out an update or two to the PowerBASIC compiler range too...

      Ok. You get the idea. As I said I'm in pain and feeling cynical.

      PowerBASIC could throw resources at this kind of project, but several things could happen... (BTW, this is not the 1st time this sort of thing has been said over the years)

      1. PowerBASIC does not have *unlimited* resources.

      2. If PowerBASIC took folks off real development work (you know, the folks making those fast and lean compilers and everything else that is required to do that task, like making coffee, ordering pizza, etc :cool , then PowerBASIC would have some documentation that *maybe* some existing customers would read, and maybe some new customers would read if they had a VB or C (or whatever) background, but the primary product line would suffer because of the reduced person-hours dedicated to it.

      3. Because of the added overheads, PowerBASIC would have to bump the price up of compiler products.

      Now, at this point, customers would be able to buy a product that costs more and likely to be updated less frequently.

      I would hazard a guess and say that few of the existing PB customers would be interested in, say, a VB to PB handbook, but the price rise would have to be inflicted on everybody, even those buying an upgrade to an existing product (in an attempt to recover some of the costs, pay staff, run tech support, taxes, AND pay for coffee and pizza (g)).

      The other way would be for PowerBASIC to make these handbooks available separately for say, $100 - $200 (I just plucked a figure out of the air here!), or less, but only if there was a guaranteed market for 20,000 copies or more (remember, this would be based on the likelyhood of mainly new or inexperienced customers who would really buy such a book). Even at such a "low" price, it would likely not cover costs either). Now a copy of PB/DLL would jump from $189 to $289 or more, if you wanted the book. Now the price would be getting close to what VB customers would be paying. Also, the higher the price, the less sales. Hmmmm...

      Yet another way (rather than writing a book on the subject) would be to provide a place for people to ask specific questions on converting from one language to another.

      Hey! That sounds kinda familar for some reason?!

      Anyway, I hope you get the idea. Writing brief guidelines may be sufficient for some people, but pleasing everyone all the time is sure hard at the best of times. Every single person here is more than welcome to write a guideline on converting from one language to another, but so far I've not seen anyone try or even offer to even write a C to PB translation guide.

      Thanks for bearing with me through the pain.

      Yours in pain,
      mailto:[email protected]


      • #4
        Lance, I think you hit the nail on the head. A lot of what we as customers expect sometimes may not be within the realm of feasible possiblity. Since it's not really PowerBasic's job to provide this sort of thing, it should come from the user community (and I'm NOT being sarcastic; I'm serious).

        Since I too have struggled with C-to-PB conversions from time to time (mainly so I can port some C SDK code or at least understand the SDK documentation) as I suspect some others have, I will gladly provide web space and "editorial managment" to keep an ongoing document on the subject. Thus, PowerBasic doesn't have to take time away from doing what you do best, and we can adapt the document to our own liking and at our own speed. And because it will be a document of the community, PowerBasic will not be responsible or liable for it (though you guys would certainly be welcome and encouraged to add to it!).

        I will confess straight-away that I am not an expert on the subject of C-to-PB conversion, but would be glad to maintain the document and provide it a home. I don't know that I could contribute a lot to it at the outset as I'm also still learning and would invariably introduce dumb mistakes, but I will try. Anyone who thinks this is a useful thing to maintain this sort of a document, please email me (or respond here with your contact info) and I'll get it set up on a page today.

        Troy King
        mailto:[email protected][email protected]</A>

        [This message has been edited by Troy King (edited June 11, 2000).]
        Troy King
        katravax at yahoo dot com


        • #5
          Originally posted by Patrice Terrier:
          I do like your suggestion.
          It is sometime very hard to translate C to PB when you don't have a deep knowledge of it, reading C source code has never been a pleasure for me.
          Also a nice C to PB converter could be a very usefull utility, just a thought for a new third party addon
          And what about a PB to C converter
          I look forward to seeing your C to PB converter with skins support. A PB to C converter is probably a subversive notion.

          Seriously, folks, there's been some discussion in-house about writing a C to PB converter. However, it's not exactly a trivial job, and there are more important things that need doing. If someone would like to develop such a product, I'm sure there's a market for it. Possibly not a large market, but you never know. When you're done writing it, we'll be glad to give you a listing on the Add-on Vendors page!

          Tom Hanlin
          PowerBASIC Staff


          • #6
            It is completely unreasonible to ask (or expect) PB Support take on extra work that would help so few and take so many resources away from PB.

            Their time would be much better spent correcting the defects the the compilers and releasing a update that would correct the problems we have been having to work around since PBDLL 5.0.




            • #7
              Books? Did someone say Books?

              Here is one from the KING OF BOOKS (that's me )

              Dan Appleman's Win32 API Puzzle Book and Tutorial for Visual Basic Programmers.

              Publisher: Apress
              Author: Dan Appleman
              ISBN: 1-893115-0-11

              And get yourself a "C Pocket Reference" for $9.95.

              After I explore these two ref's and I am still stuck,
              than I use my best resource, the people on this forum.

              They are the BEST!!!!!!!!

              Regards, Jules


              • #8
                Let's go one further:

                Its about time someone wrote a Windows programming book for PowerBasic itself and simply skip C completely

                There are tons of books about programming in C.
                There are tons of books about programming in VB.

                Its about time to have one for PowerBasic.

                Chris Boss
                Computer Workshop
                Developer of "EZGUI"


                • #9
                  Ok folks it was just a suggestion to win more powerbasic customers...... but as I can see of the reactions, support as a lot of other work to do.........



                  • #10
                    I sure like that C to PB idea. That is one tool that I would pay dollars for. With so much excellent open source code floating around I can think of dozens of projects that could benefit from a tool like that . The Delphi community has something like this.