| |

VerySource

 Forgot password?
 Register
Search
View: 860|Reply: 6

Why is there an error when passing parameters?

[Copy link]

4

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-3-11 19:00:01
| Show all posts |Read mode
Private Sub loopMonthRow (fst_date_mm, fst_date_dd, last_date_mm, last_date_dd As String, row_no As Integer)
loopToFstMonthOrDate fst_date_mm&STR_MONTH_NM, INT_ROW_MONTH
loopToFstMonthOrDate fst_date_dd, INT_ROW_DATE

End Sub

Private Sub loopToFstMonthOrDate (content As String, row As Integer)
. . .
End Sub

When I execute loopMonthRow this method always reports an error
loopToFstMonthOrDate fst_date_dd, INT_ROW_DATE
Fst_date_dd parameter in "BYREF parameter type does not match", but when I change to
loopToFstMonthOrDate fst_date_dd&"", will be correct after INT_ROW_DATE. This is the reason for the company. What should we do?
Reply

Use magic Report

0

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-6-6 14:30:01
| Show all posts
The parameter types in loopToFstMonthOrDate(content As String, row As Integer) are explicitly declared if
Set loopMonthRow(fst_date_mm, fst_date_dd, last_date_mm, last_date_dd As String, row_no As Integer)
The parameters in are also explicitly declared, and have the same value as the parameter type passed when calling loopToFstMonthOrDate. fst_date_dd&"" is equivalent to forcibly converting fst_date_dd to a string type, which is the same as the parameter type in loopToFstMonthOrDate, so no error will be reported.
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-8-4 18:45:01
| Show all posts
It is recommended that the host should display the specified type when defining variables, otherwise it is easy to make mistakes
Reply

Use magic Report

4

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-8-5 18:45:03
| Show all posts
How to specify the type of the variable explicitly or implicitly when defining a variable
Reply

Use magic Report

4

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-8-5 19:30:02
| Show all posts
"in case
LoopMonthRow(fst_date_mm, fst_date_dd, last_date_mm, last_date_dd As String, row_no As Integer)
The parameters in are also explicitly declared,"
Isn't my parameter here explicitly declared?
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-8-5 19:45:01
| Show all posts
I don't know what type of variable is fst_date_mm
Reply

Use magic Report

1

Threads

21

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 Great Britain

Post time: 2020-8-5 23:45:02
| Show all posts
"in case
LoopMonthRow(fst_date_mm, fst_date_dd, last_date_mm, last_date_dd As String, row_no As Integer)
The parameters in are also explicitly declared,"
Isn't my parameter here explicitly declared?

What is the data type of fst_data_mm, fst_date_dd, last_date_mm?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list