Author Topic: Programming errors on QB64  (Read 6138 times)

0 Members and 1 Guest are viewing this topic.

Offline kservice

  • Newbie
  • Posts: 25
    • View Profile
Re: Programming errors on QB64
« Reply #15 on: September 26, 2021, 02:19:05 pm »
It's clear. And what about an "IncorRect Array Type Passed to Sub" error ?

Offline kservice

  • Newbie
  • Posts: 25
    • View Profile
Re: Programming errors on QB64
« Reply #16 on: October 09, 2021, 01:10:36 pm »
I probably did something wrong if I stopped answering my questions? In this case, I ask the yen to apologize.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Programming errors on QB64
« Reply #17 on: October 09, 2021, 01:55:54 pm »
It's clear. And what about an "IncorRect Array Type Passed to Sub" error ?

Incorrect Array Type Passed to Sub comes from... wait for it... passing an incorrect array type to a SUB!!  😂😂

An example:

SUB Foo (an_array() AS INTEGER)
     ...stuff
ENS SUB

A fairly standard SUB, doing standard stuff with an array.  All is good here, until:

DIM data_array(100) AS LONG
Foo data_array()

Now our SUB expects an array of INTEGER type.  We just tried to pass it an array of LONG type.  What’s the result?

You guessed it!

Incorrect Array Type Passed to Sub Error

Pass them the types they except and you won’t see that message any more.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline kservice

  • Newbie
  • Posts: 25
    • View Profile
Re: Programming errors on QB64
« Reply #18 on: October 10, 2021, 05:09:05 am »
Thank you, I will understand

Offline kservice

  • Newbie
  • Posts: 25
    • View Profile
Re: Programming errors on QB64
« Reply #19 on: October 10, 2021, 10:38:16 am »
When i try to rename an old file to file.bak and data records to a new file, I collided with such errors:
  [ You are not allowed to view this attachment ]    [ You are not allowed to view this attachment ]  
What can you suggest?

Offline kservice

  • Newbie
  • Posts: 25
    • View Profile
Re: Programming errors on QB64
« Reply #20 on: October 10, 2021, 01:36:31 pm »
Refinement: String 2426 This is a string: Name F2 $ AS MID $ (F2 $, 1, Len (F2 $) - 3) + "BAK"
I noticed that if you make a Name "bigbad.txt" as "badwolf.txt", then this error disappears. But I need to use a conditional f2$, as each time they are different when using the procedure. In other words, I need this option: Name "f2$" AS "f2new$"

How can I get out of this position?
In QB45 it worked. Is it possible to find a solution option in QV64?

Offline kservice

  • Newbie
  • Posts: 25
    • View Profile
Re: Programming errors on QB64
« Reply #21 on: October 12, 2021, 11:46:09 am »
The last problem is solved by the use of Field 2, 10 AS ...... and LSET .... instead of Print # 2, using "##############. ##