Thanks for your reply but i can't register data.
Code: Select all
XIncludeFile "D:\Applications\Pure Basic\Pb2Web\p2w.pbi"
P2W_Converter_SetProfile("pb2webtest")
Enumeration
#mainform
#fmuserslist
#fmuser
#fmlocation
#fmuserupdate
EndEnumeration
ProcedureDLL.s WriteUserAndLocation(User.s, Location.s)
Protected FF
FF = OpenFile(#PB_Any, "users.txt", #PB_File_Append)
If FF
WriteStringN(FF, User + "|" + Location)
CloseFile(FF)
ProcedureReturn "OK"
Else
ProcedureReturn "!OpenFile()"
EndIf
EndProcedure
Procedure DataRecord()
Protected user.s
Protected location.s
Protected ReturnValue.s
user = GetGadgetText(#fmuser)
location = GetGadgetText(#fmlocation)
If Trim(user) = ""
MessageRequester("Information", "The username you entered is too short.")
Else
ReturnValue = WriteUserAndLocation(user, location)
Debug "WriteUserAndLocation say " +ReturnValue
If Left(ReturnValue, 2) = "OK" ; ReturnValue contains linebreak
SetGadgetText(#fmuser, "")
SetGadgetText(#fmlocation, "")
MessageRequester("Information", "Updated.")
AddGadgetItem(#fmuserslist, -1, user+Chr(10)+location)
Else
MessageRequester("Information", "Something went wrong")
EndIf
EndIf
EndProcedure
Procedure WindowShow()
OpenWindow(#mainform, 0, 0, 450, 450, "Demo : Test open and write file", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_ScreenCentered)
SetWindowColor(#mainform, RGB(255, 239, 213))
ListIconGadget(#fmuserslist, 20, 40, 400, 300, "User", 200)
AddGadgetColumn(#fmuserslist, 1, "Location", 200)
TextGadget(#PB_Any, 20, 350, 80, 25, "User")
StringGadget(#fmuser, 100, 350, 200, 22, "")
TextGadget(#PB_Any, 20, 390, 80, 25, "Location")
StringGadget(#fmlocation, 100, 390, 200, 22, "")
ButtonGadget(#fmuserupdate, 310, 350, 80, 22, "Update")
TextGadget(#PB_Any, 20, 430, 400, 22, "Proudly Powered by <b>Pure Basic</b> & <b>PB2Web</b>")
BindGadgetEvent(#fmuserupdate, @DataRecord())
EndProcedure
WindowShow()
P2W_Converter_Begin_Comment
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
P2W_Converter_End_Comment
■ Profile Manager setting.
■ Result when I am trying to validate a user.