以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  从字符串“”到类型“Date”的转换无效  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=121981)

--  作者:zoyong
--  发布时间:2018/7/16 20:43:00
--  从字符串“”到类型“Date”的转换无效
Dim wb As New WeUI
wb.AddForm("","form1","dclb.htm")
With wb.AddListGroup(" ", "lsg1","")
    With wb.AddInputGroup("","ipg1","菜单供应设置")
            Dim rq1 As Date
            rq1 = .AddInput("rq","日期","date").Value
        With .AddInput("rq","日期","date")
            .Enabled = False
            .Value = Format(rq1,"dddd")
        End With
        With .AddInput("xq","星期","text")
            
            .Enabled = False
            .Value = Format(rq1,"dddd")
        End With
        With .AddInput("djsj","登记时间","datetime-local")
            .value = Format(Date.Now,"HH:mm")
            .Min = "08:00" \'输入的事件必须在8:00到12:00之间
            .Max = "12:00"
        End With
        .AddInput("zc","早餐","text")
        .AddInput("wc","午餐","text")
        .AddInput("sf","晚餐","text")
    End With
End With
With wb.AddArticle("","ar1")
    .AddTitle("h1","备注")
    .AddContent("设置每天供应的菜品,需每天设置.")
End With
e.WriteString(wb.Build)


.NET Framework 版本:2.0.50727.8745
Foxtable 版本:2018.7.9.1
错误所在事件:自定义函数订餐类别
详细错误信息:
调用的目标发生了异常。
从字符串“”到类型“Date”的转换无效。

[此贴子已经被作者于2018/7/16 20:57:46编辑过]

--  作者:有点蓝
--  发布时间:2018/7/16 21:03:00
--  
自定义函数“订餐类别”完整代码贴出来

Dim wb As New WeUI
wb.AddForm("","form1","dclb.htm")
With wb.AddListGroup(" ", "lsg1","")
    With wb.AddInputGroup("","ipg1","菜单供应设置")
        With .AddInput("rq","日期","date")
            .Enabled = False
            .Value = rq
        End With
        With .AddInput("xq","星期","text")
            .AddInput("xq","星期","text").Enabled = False
            .AddInput("xq","星期","text").Value = Format(rq,"dddd")
        End With
        With .AddInput("djsj","登记时间","time")
            .value = Format(Date.Now,"HH:mm")
            .Min = "08:00" \'输入的事件必须在8:00到12:00之间
            .Max = "12:00"
        End With
        .AddInput("zc","早餐","text")
        .AddInput("wc","午餐","text")
        .AddInput("sf","晚餐","text")
    End With
End With
With wb.AddArticle("","ar1")
    .AddTitle("h1","备注")
    .AddContent("设置每天供应的菜品,需每天设置.")
End With
e.WriteString(wb.Build)

--  作者:zoyong
--  发布时间:2018/7/16 21:30:00
--  
编译错误

图片点击可在新窗口打开查看此主题相关图片如下:360截图20180716212812594.jpg
图片点击可在新窗口打开查看


我是用表动态合成网页的代码
Dim drx As DataRow = DataTables("订餐网页表").SQLFind("网页=\'" & e.Path & "\'")
If drx IsNot Nothing Then
    e.AsyncExecute = True  \'通知系统,将采用异步方式生成网页
    Functions.AsyncExecute(drx("函数名称"),e) \'异步调用函数生成网页
End If


--  作者:有点蓝
--  发布时间:2018/7/16 21:36:00
--  
合成后输出完整的结果查看,with 和end with不成对
--  作者:zoyong
--  发布时间:2018/7/16 21:37:00
--  
找到原因    谢谢有点蓝