asp里的function和VB里的function语法上有什么区别啊?

kukat 2005-12-12 10:11:13
VB里面的

************************************************************************************** Function balance_MoneyResult(ByVal ScoreHome As Integer, ByVal ScoreLeftway As Integer, ByVal ScoreLeft As Double, ByVal ScoreRight As Double, ByVal BetMoney As Double, ByVal pay1 As Double) As Double
**************************************************************************************

放在asp里怎么就用不了?

**************************************************************************************
Microsoft VBScript 编译器错误 错误 '800a03ee'

缺少 ')'

/admin_game1_balances.asp,行 112

Function balance_MoneyResult(ByVal ScoreHome As Integer, ByVal ScoreLeftway As Integer, ByVal ScoreLeft As Double, ByVal ScoreRight As Double, ByVal BetMoney As Double, ByVal pay1 As Double) As Double
---------------------------------------------^
**************************************************************************************
...全文
165 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
KimSoft 2005-12-13
  • 打赏
  • 举报
回复
把AS XXX 全部去掉。
----------------------------------
还有VB里的一些函数VBS不能用。
下表列出未包含在 VBScript 中的 Visual Basic for Applications 特性。

类别 特性/关键字
数组处理 Option Base
声明数组下界 <> 0
集合 Add, Count, Item, Remove
使用 ! 字符访问集合
条件编译 #Const
#If...Then...#Else
控制流程 DoEvents
GoSub...Return, GoTo
On Error GoTo
On...GoSub, On...GoTo
Line numbers, Line labels
转换 CVar, CVDate
Str, Val
数据类型 除 Variant 外的所有固有数据类型
Type...End Type
日期/时间 Date 语句、Time 语句
DDE LinkExecute, LinkPoke, LinkRequest, LinkSend
调试 Debug.Print
End, Stop
声明 Declare (声明 DLL )
Optional
ParamArray
Static
错误处理 Erl
Error
Resume, Resume Next
文件输入/输出 所有传统的基本文件输入/输出 (I/O)
财务 所有财务函数
对象操作 TypeOf
对象 Clipboard
Collection
运算符 Like
选项 Deftype
Option Base
Option Compare
Option Private Module
选择条件 包含 Is 关键字或任何比较运算符的表达式
包含一系列使用 To 关键字的数值的表达式
字符串 固定长度字符串
LSet, RSet
Mid 语句
StrConv
使用对象 使用 ! 对集合的访问




----------------------------------
VBS里的东东VB里也不能用。
下表列出了未包含在 Visual Basic for Applications 中的 VBScript 特性。

分类 特性/关键字
声明 Class
杂项 Eval
Execute
对象 RegExp
Script 引擎标识 ScriptEngine
ScriptEngineBuildVersion
ScriptEngineMajorVersion
ScriptEngineMinorVersion
无爱大叔 2005-12-13
  • 打赏
  • 举报
回复
Function balance_MoneyResult(ByVal ScoreHome As Integer, ByVal ScoreLeftway As Integer, ByVal ScoreLeft As Double, ByVal ScoreRight As Double, ByVal BetMoney As Double, ByVal pay1 As Double) As Double
=>>
Function balance_MoneyResult(ByVal ScoreHome, ByVal ScoreLeftway, ByVal ScoreLeft, ByVal ScoreRight, ByVal BetMoney, ByVal pay1)

vbs是弱类型语言,不用强调变量的类型如:As Integer, As String这些强调变量类型的vb语法,在vbs中会报错,所以去掉他们.
lxcooi 2005-12-13
  • 打赏
  • 举报
回复
vbs不能声明变量类型,也就是说,vbs中全部值变量(只是值变量,对象变量不是哦)都是变体型。
asp只是运行环境,你书写的语言是VbScript。
kukat 2005-12-12
  • 打赏
  • 举报
回复
VB里面的

	Function balance_MoneyResult(ByVal ScoreHome As Integer, ByVal ScoreLeftway As Integer, ByVal ScoreLeft As Double, ByVal ScoreRight As Double, ByVal BetMoney As Double, ByVal pay1 As Double) As Double


放在asp里怎么就用不了?

Microsoft VBScript 编译器错误 错误 '800a03ee' 

缺少 ')'

/admin_game1_balances.asp,行 112

Function balance_MoneyResult(ByVal ScoreHome As Integer, ByVal ScoreLeftway As Integer, ByVal ScoreLeft As Double, ByVal ScoreRight As Double, ByVal BetMoney As Double, ByVal pay1 As Double) As Double
---------------------------------------------^

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧