locked
Network class "Network.GetWebPageContents" doesn't work when published as silverlight RRS feed

  • Question

  • This code is working well in the Small Basic Editor:

    TextWindow.WriteLine(Network.GetWebPageContents("http://www.smallbasic.com"))

    But it's hanging in the Browser:

    http://smallbasic.com/program/?NDK876

    Is anything wrong with the code?

    Saturday, June 12, 2010 10:27 PM

Answers

  • Some features of Small Basic don't work on the Silverlight (online) interpreter. It's mainly because of the security restrictions applied on the control. I agree with you features that don't work in Silverlight should return an error (for exemeple telling you the program is too complex to run online and you should download it and run locally) and stop the program execution.

    Nothing wrong with your code, just online security restriction & lack of features.

    Does it answer your question ?


    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    • Proposed as answer by FremyCompany [MSFT] Monday, June 14, 2010 8:59 AM
    • Marked as answer by litdev Wednesday, June 16, 2010 6:32 PM
    Monday, June 14, 2010 8:58 AM

All replies

  • man, some file operation are commented (it auto-adds a single quote) so it doesn't work, maybe this happened with your code.

    i never used that function so i dont know...


    |"| /"/|"""\ /"""\|"| |__ __| /\ |"""\ |"| | |/ / | " / | | || | | | / \ | |\ \ | | | |\ \ | | \ | | || |__ | | / \ | | \ \| | |_| \_\|_|\_\\___/|____| |_| /_/""\_\|_| \___|
    Sunday, June 13, 2010 10:24 PM
  • Some features of Small Basic don't work on the Silverlight (online) interpreter. It's mainly because of the security restrictions applied on the control. I agree with you features that don't work in Silverlight should return an error (for exemeple telling you the program is too complex to run online and you should download it and run locally) and stop the program execution.

    Nothing wrong with your code, just online security restriction & lack of features.

    Does it answer your question ?


    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    • Proposed as answer by FremyCompany [MSFT] Monday, June 14, 2010 8:59 AM
    • Marked as answer by litdev Wednesday, June 16, 2010 6:32 PM
    Monday, June 14, 2010 8:58 AM
  • I noticed that the silverlight interepertor is better then the last version. There are still problems though.

    But the other important thing that I have found is that if you graduate your program to Visual Basic, it is relatively easy to covert it to silverlight.

    I was wondering if it was possible to prefix your extensions with FC. rather then just FC  this would make it more compatible with nigher level languages.

    It would be really nice if Smallbasic did that automatically, specifically take the file name minus and use that as the prefix.  For example Bobs.dll would automatically become Bobs.MyMethod

    Many thanks all!

    Bob

     

    Monday, June 14, 2010 3:56 PM
  • Well, I can't. An object' name cannot contain any dot. In my own code there's a FC namespace but Small Basic never took that in consideration, because of its internal way to represent the intellisense, mainly. Agree it would be more elegant, though, but it would introduce a new level of complexity to small basic, which is not acceptable.


    Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extension
    Monday, June 14, 2010 5:15 PM
  • so that sounds reasonable, network funcions restricted for security. I'll try to export to visual basic and convert it to silverlight.

    Maybe it will work with a future version of small basic!?

    thanks for your replies

    ralf

    Wednesday, June 16, 2010 6:27 PM