Source language: Translate to:

Wikipedia

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Wikipedia

Postby Alex » Sat Feb 24, 2007 11:44 am

Hi,

I have a BIG problem.

I explain :

I have a neobook pub and I need when I write in the TextEntry the name of a objet to have the information about what I write. How it is working ? With Wikipedia, I write the name and it (downloads) search the info in the Source Code. But I can't do that because I don't understand. Here is an example, if you can help me, I will be in the paradise.


Thanks

Alex


Demo :

NBW Publication Source File
(C)1993-2007 NeoSoft Corp.
Title=Wikipedia
Author=Alexandre
Language=US
NeoBookVer=5,53
ScreenColors=16777216
ScreenWidth=640
ScreenHeight=480
BkndColor=0
ScreenAutoSize=Yes
LinkColor=16711680
WindowStyle=0
WindowOrder=0
WindowPos=0
WindowProps=31
BiDiMode=0
UseUpdateTimer=Yes
ReturnTime=60
ShapeTransColor=536870912
CompileType=0
MediaType=0
FilesIncluded=1
FontsIncluded=2
CopyExternalFiles=No
SetupMedia=3
SetupInstDir=C:\MyProgram
SetupTitle=Setup
SetupColors=16711680|0|65535
Variables=[Babelfish_Page]¶[End]¶[English_Text]¶[Start]¶[TextEntry1]¶[TextEntry2]¶[WebBrowser1Addr]¶[WebBrowser1Status]¶[WebBrowser1Title]¶
VersionProduct=Wikipedia
VersionDesc=Search in Wikipedia
VersionMajor=1
VersionMinor=0
VersionRelease=0
VersionBuild=0
CustomFontName=MS Sans Serif
CustomFontSize=8
CustomFontStyle=1
CustomCharset=1
CacheSize=30
ExtractOp=132
L_OK=OK
L_CANCEL=Cancel
L_YES=Yes
L_NO=No
L_CLOSE=Close
L_ERRORTITLE=Error
L_FINDTITLE=Find
L_FINDPROMPT=Find &What
L_FINDFIRST=&Find First
L_FINDNEXT=Find &Next
L_FINDERROR=Search text not found.
L_PWORDTITLE=Password required continuing, you must first|enter the correct password.
L_PWORDPROMPT=&Password:
L_PWORDERROR=That's not the right password!
L_MEDIAERROR=In order to play this type of file you must install|the appropriate multimedia hardware and/or|software.
L_INTERNETERROR=Unable to locate Internet Browser software.
L_ABORTFUNCTION=Do you want to cancel this function?
L_EXTRACTERROR=This file could not be extracted and cannot be played.
L_INSTDIRPROMPT=Please enter the drive and directory where you would like this program to be installed. To accept the default drive and directory, simply press Enter.
L_INSTFOLDERPROMPT=Do you wis
L_INSTRUNPROMPT=Do you want to run
L_INSTDISKPROMPT=Please insert disk #
L_INSTDISKERROR=That's not the correct disk, try again.
L_INSTGENERROR=The installation has terminated.
L_INSTEXITPROMPT=Do you really want to cancel the installation?
L_INSTWINTITLE=Setup
L_INSTPROGTITLE=Extracting Files...
L_PLEASEWAIT=Please wait...
TrayMenuBegin
MenuName=TrayOpen
MenuText=Open
MenuState=3
MenuKey=0
MenuAction=SetVar "[WindowState]" "Normal"
MenuName=TrayExit
MenuText=Exit
MenuState=3
MenuKey=0
MenuAction=Exit "" ""
MenuEnd
QunCsr=6
X=20
Y=141
W=203
H=39
Anchor=0
Font=Arial
FontSize=10
FontStyle=1
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\pard\keepn {{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0\b Result :}\pard }}}
HMargin=4
VMargin=8
LineColor=0
LineWidth=0
LineStyle=6
FillColor=8421376
FillPattern=0
TabOrder=5
ObjectType=14
Name=WebBrowser1
X=-141
Y=-20
W=121
H=107
Anchor=0
VarName=[WebBrowser1Status]
TitleVarName=[WebBrowser1Title]
URLVarName=[WebBrowser1Addr]
ContextMenu=No
ObjAction=DisableObject "PushButton1"¶DisableObject "TextEntry2"¶SetObjectFill "TextEntry2" "Silver" "Solid" "False"¶SetVar "[Status]" "Please wait, connecting to Wikipedia..."
NavCompAction=SetVar "[Status]" "Please wait, almost done..."¶¶. Export Source HTML to [Wikipedia]¶BrowserExport "WebBrowser1" "[Wikipedia]"¶¶. Find the [Start] of the result¶SearchStr "<!--sdvD=RES-->" "[Wikipedia]" "[Start]"¶SetVar "[Start]" "[Start]+15"¶¶. Find the [End] of the result¶SearchStr "<!--sdvF=RES-->" "[Wikipedia]" "[End]"¶¶. Conclusion: found the [Result]¶SubStr "[Wikipedia]" "[Start]" "[End]-[Start]" "[Result]"¶¶. Replace all occurances of <BR> with [#13][#10] (Carriage Return + Line Feed)¶StrReplace "[Result]" "<BR>" "[#13][#10]" "[Result]"¶¶. Remove all HTML tags¶StrLen "[Result]" "[LenResult]"¶Loop "1" "[LenResult]" "[Cnt]"¶ SearchStr "<" "[Result]" "[HookLeft]"¶ SearchStr ">" "[Result]" "[HookRight]"¶ StrDel "[Result]" "[HookLeft]" "[HookRight]-([HookLeft]-1)" "[Result]"¶EndLoop¶¶EnableObject "PushButton1"¶EnableObject "TextEntry2"¶SetObjectFill "TextEntry2" "White" "Solid" "False"¶FocusObject "TextEntry2"¶¶SetVar "[Status]" "Complete"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=65535
FillPattern=0
Font=Comic Sans MS
FontSize=8
FontStyle=1
FontCharset=1
TextColor=0
TabOrder=1
ObjectType=9
Name=TextEntry1
X=35
Y=63
W=270
H=33
Anchor=0
VarName=[Word]
EditLen=0
LineColor=-2147483632
LineWidth=1
LineStyle=6
FillColor=16777215
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=2
ObjectType=9
Name=TextEntry2
X=20
Y=168
W=601
H=255
Anchor=0
VarName=[Result]
EditMultiLine=Yes
EditLen=0
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Enabled=No
TabOrder=3
ObjectType=3
Name=PushButton1
X=358
Y=57
W=132
H=46
Anchor=0
Text=OK
Align=2
ImageStyle=0
BevelWidth=1
ObjAction=. Go to the URL and insert the word to be found¶StrReplace "[Word]" " " "_" "[Word]"¶BrowserGoTo "WebBrowser1" "http://fr.wikipedia.org/wiki/[Word]"
LineColor=-2147483632
LineWidth=1
LineStyle=0
FillColor=-2147483633
FillPattern=0
Font=Arial
FontSize=10
FontStyle=1
FontCharset=1
TextColor=0
TabOrder=4
ObjectType=8
Name=Text3
X=20
Y=436
W=602
H=37
Anchor=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 [Status]}}}
HMargin=4
VMargin=8
LineColor=-2147483632
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=6
Last edited by Alex on Wed Feb 28, 2007 3:41 pm, edited 2 times in total.
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Neosoft Support » Mon Feb 26, 2007 12:11 pm

The problem appears to be in your browser object's "Navigate Complete" action. Specifically, the tags your searching for below don't exist in the HTML code you're attempting to parse:

. Find the [Start] of the result
SearchStr "<!--sdvD=RES-->" "[Wikipedia]" "[Start]"
SetVar "[Start]" "[Start]+15"

. Find the [End] of the result
SearchStr "<!--sdvF=RES-->" "[Wikipedia]" "[End]"
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Alex » Mon Feb 26, 2007 11:05 pm

Hi,

Yes, it was in an other example, but I don't know what I have to write here !!!


Thanks



Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest