Announcement

Collapse
No announcement yet.

Incorrect Function

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

  • Incorrect Function

    Has anyone received an "Incorrect function" message followed by a "can't save file" message when attempting to compile from the pbwin 10x IDE?
    Walt Decker

  • #2
    No, I have not. Anything unusual in your source code?
    Dale

    Comment


    • #3
      No. It's even giving me those messages on previously compiled apps.

      Have a hunch the compiler has somehow been corrupted.
      Walt Decker

      Comment


      • #4
        Walt,
        Do you have a previous version of the compiler to use?

        Comment


        • #5
          Not currently, Mr. Fritts. I do, however, have pbwin9x on this computer. It works fine. Just doesn't have all the bells and whistles. Probably have to take a step back for a while.

          Recently moved from Nevada to Arizona. Most of my stuff is in storage until the first week in June. After I get unpacked I'll be able to reinstall from the original disk.
          Walt Decker

          Comment


          • #6
            Try re-naming PBWIN.INI so that a new one is generated next time PBEDIT.EXE is started?
            Rgds, Dave

            Comment


            • #7
              Mr. Biggs, renaming pbwin.ini did not help. Oh, well, one step back won't hurt. I used pbwin.9x for quite a while after ver. 10 was released. It's no big deal.
              Walt Decker

              Comment


              • #8
                Ok

                Comment


                • #9
                  Well, finally received all my computer stuff. Renamed the pbwin10 directory, reinstalled pbwin10.03. Tried to compile a file and receive the same result: can't compile "INCORRECT FUNCTION". Apparently something has changed in the ms10 operating system. Haven't a clue why pbwin9x works and 10 does not. Strange.
                  Walt Decker

                  Comment


                  • #10
                    If you have PB9 incude files, try pointing PBWin10 at those instead and see if it works. I have a few programs that were created with an earlier version and have not bothered to change calls to some functions that are declared slightly differently in the PB include files, so simply inserted full path like for example "PBWin90/WinAPI/WIN32API.INC" in code and it has worked fine for me.

                    PS, what function does error point at? Could be a simple fix too, if one follow error report and look where caret is placed.

                    Comment


                    • #11
                      Mr. Hagsten:

                      The compiler does not indicate which function is incorrect. As an example;
                      Code:
                      COMPILE EXE
                      
                      FUNCTION PBMAIN()
                      
                      MSGBOX "Hello"
                      
                      END FUNCTION
                      produces the same message as does FUNCTION WINMAIN(.......)


                      Walt Decker

                      Comment


                      • #12
                        Does the IDE also indicate any other messages along with Incorrect function? Or just incorrect function when compiling?

                        Does it tell you the target file was successfully created, or no?

                        Does it tell you cannot launch the target file prior to 'Incorrect Function'?
                        Adam Drake
                        Drake Software

                        Comment


                        • #13
                          A couple of threads here on the topic ...most recently by me in 2017, using Win10.04.

                          https://forum.powerbasic.com/forum/u...rrect-function

                          Comment


                          • #14
                            produces the same message as does FUNCTION WINMAIN(.......)
                            Yes, but is it error 484?
                            Did you intentionally leave off the # in that example (as Stuart will say below)
                            Code:
                            COMPILE EXE
                            FUNCTION PBMAIN()
                             MSGBOX "Hello"
                            END FUNCTION
                            Error 484 in C:\sql\bin\junk.bas(1:001): Requires Procedure (Function/Method...)
                            Line 1: COMPILE EXE


                            Under Windows, options, compiler: What is your path to include files?
                            Roca includes?
                            PBEdit shortcut Run as administrator?
                            Nothing get marked in anti-virus?
                            Checked drive for errrors Chkdsk c: /f ?
                            sfc /scannow ?

                            https://duckduckgo.com instead of google

                            Comment


                            • #15
                              Originally posted by Mike Doty View Post
                              Code:
                              COMPILE EXE
                              FUNCTION PBMAIN()
                              MSGBOX "Hello"
                              END FUNCTION
                              Error 484 in C:\sql\bin\junk.bas(1:001): Requires Procedure (Function/Method...)
                              Line 1: COMPILE EXE

                              You get error 484, right?



                              Under Windows, options, compiler: What is your path to include files?

                              It would help to put a # in front of COMPILE

                              Comment


                              • #16
                                Folks:

                                The entire message is:

                                "Cannot compile BASIC file "E:\PBWIN10\WD_PROJECTS\GFX_EDITBOX_4.BAS. Incorrect function."

                                I thought it might be a firewall issue so changed my firewall settings; same result. There are no words like "setup", "startup", etc. in the code. And why it affects PBWIN10X and not PBWIN9X I have not a clue.

                                PS:
                                The short example I gave was off the top of my head. I did try it with all the correct syntax
                                Code:
                                #COMPILE EXE
                                
                                FUNCTION PBMAIN()
                                
                                MSGBOX "Hello"
                                
                                END FUNCTION
                                Walt Decker

                                Comment


                                • #17
                                  > "Cannot compile BASIC file "E:\PBWIN10\WD_PROJECTS\GFX_EDITBOX_4.BAS. Incorrect function."

                                  Could try XCOPY /e/r/y E:\PBWIN10\*.* C:\PBWIN10\*.*
                                  Change settings to point to C: drive and see if that works.
                                  Now it looks like a path or environment variable problem.

                                  Under Windows, options, compiler: What is your path to include files?
                                  Roca includes?
                                  PBEdit shortcut Run as administrator?
                                  Nothing getting marked in anti-virus?
                                  Checked drive for errrors Chkdsk c: /f ?
                                  sfc /scannow ?
                                  Are include files involved?
                                  Resource file involved?
                                  Is project file involved?
                                  https://duckduckgo.com instead of google

                                  Comment


                                  • #18
                                    Mr. Doty:

                                    PBWIN10 worked on all paths up until about 3 weeks ago. If it is a path or environment variable problem it should have shown up long before then. There are no include files, no project files other than the main. If it is a disk error PB9 would have the same problem. The PBEdit shortcut is not "run as administrator." Nothing is taged as a virus.

                                    I'm almost sure it is a windows problem. The next step I plan to take is try with a manifest resource.
                                    Walt Decker

                                    Comment


                                    • #19
                                      Copying the files could correct an invalid registry entry.
                                      Hope you find the problem.
                                      https://duckduckgo.com instead of google

                                      Comment


                                      • #20
                                        Do you have the File Backup option turned on in PowerBASIC.
                                        If so, maybe go back and see if one of Backup files will compile.
                                        Hope so, then you could compare files and see what is causing it.

                                        Does this happen compiling all new programs?
                                        https://duckduckgo.com instead of google

                                        Comment

                                        Working...
                                        X