Jump to content
UBot Underground

Frank

Fellow UBotter
  • Content Count

    1069
  • Joined

  • Last visited

  • Days Won

    43

Posts posted by Frank

  1. I create a sqlite database right on the user's computer and access it locally. I really want to migrate to a package like opentables which written in javascript can use ajax to query a database to update it's display.

     

    To be honest, is you have an example doing that with ubot, it would be excellent - just the access table data part that is. I've kind of run myself around a bend on this one.

     

    Frank

  2. Hey all,

     

    I'm trying to figure out how to use the powers of ajax to access a local sqlite database within ubot. I've got Aymen's database plugin but I'm stumped on how to tie to two together to do intelligent database calls for a jQuery controlled table.

     

    Any hints, thoughts, leads would be GREATLY appreciated.

     

    Thanks!

     

    Frank

  3. schau mal ob dir das was taugt schon lange nicht mehr benutzt...

     

     

    plugin command("Open.Framework_new.dll", "Structure Container", "JSON LIST") {
        clear list(%jsonlist)
        add list to list(%jsonlist, $list from text(#TABLE or LIST, $new line), "Don\'t Delete", "Local")
        clear list(%json_columnnames)
        add list to list(%json_columnnames, $list from text(#COLUMNNAMES, ","), "Don\'t Delete", "Global")
        clear list(%JSONLISTclean)
        set(#JSON recid name, "recid:", "Global")
        set(#JSON recid counter, 1, "Global")
        comment("HIER WERDEN DIE DATENSÄTZE ZUSAMMEN GEBAUT")
        loop($list total(%jsonlist)) {
            set(#list_record, $next list item(%jsonlist), "Global")
            clear list(%list_record)
            add list to list(%list_record, $list from text(#list_record, #SEPARATOR), "Don\'t Delete", "Local")
            set(#list_record_total, $list total(%list_record), "Global")
            set(#list_record_total_counter, 0, "Global")
            set(#jsonval, "\{{#JSON recid name} {#JSON recid counter},", "Global")
            set(#jsonval counter, 0, "Global")
            loop($list total(%list_record)) {
                set(#item, $list item(%list_record, #jsonval counter), "Global")
                if($comparison(#list_record_total, "=", #list_record_total_counter)) {
                    then {
                    }
                    else {
                        set(#jsonval, "{#jsonval}f{$change text casing($list item(%json_columnnames, #jsonval counter), "Lower Case")}: \"{#item}\", ", "Global")
                    }
                }
                increment(#jsonval counter)
                increment(#list_record_total_counter)
            }
            set(#jsonval, "{#jsonval}\},", "Global")
            set(#jsonval, $replace(#jsonval, ", \}", "\}"), "Global")
            set(#jsonval, $replace(#jsonval, ",\}", "\}"), "Global")
            add item to list(%JSONLISTclean, #jsonval, "Don\'t Delete", "Global")
            set list position(%list_record, 0)
            increment(#JSON recid counter)
        }
        clear list(%jsonlist)
        clear list(%list_record)
        clear list(%json_tmp)
        set list position(%json_columnnames, 0)
        set(#jsonsize, $divide(100, $list total(%json_columnnames)), "Global")
        set(#jsonsize, "{#jsonsize}%", "Global")
        comment("HIER WERDEN DIE  COLUMNS GEBAUT")
        set(#jsonval, "\{ field: 'recid', caption: 'ID', size: '50px', sortable: true \},", "Global")
        add item to list(%json_tmp, #jsonval, "Don\'t Delete", "Global")
        loop($list total(%json_columnnames)) {
            set(#json_col, $next list item(%json_columnnames), "Global")
            set(#jsonval, "\{field: 'f{$change text casing(#json_col, "Lower Case")}', caption: '{#json_col}', size:'{#jsonsize}',sortable: true, resizable: true, editable: \{ type: 'text' \}\},", "Global")
            add item to list(%json_tmp, #jsonval, "Don\'t Delete", "Global")
            set(#jsearch, "\{field: \'f{$change text casing(#json_col, "Lower Case")}\', caption: \'{#json_col}\', type:\'text\'\},", "Global")
            add item to list(%jsearch, #jsearch, "Delete", "Global")
        }
        set(#jsonval, %json_tmp, "Global")
        set(#jsearch, %jsearch, "Global")
        set(#jsonrec, %JSONLISTclean, "Global")
        set(#jsonval, "name: \'grid\', 
    show: \{ 
    	toolbar: true,
    	footer: true,
    	toolbarAdd: true,
    	toolbarDelete: true,
    	toolbarSave: true,
    	fixedBody: false,
    \},
    
    toolbar: \{
    	onClick: function (target, data) \{console.log(target)\}
    \},
    
    searches: [
    
    {#jsearch}
    
    	],
    sortData: [\{ field: \'recid\', direction: \'ASC\' \}],
    
    
    columns: [
    
    		{#jsonval}
    
    	],
    
    
    records:[
    
    		{#jsonrec}
    
    	]", "Global")
        set(#JSONTEMPLATE, "<!DOCTYPE HTML>
    <html>
    <head>
    <meta charset=\"utf-8\">
    <script src=\"http://skapps.webhop.net/incl/w2ui/jquery.min.js\"></script>
    <script src=\"http://code.jquery.com/ui/1.10.3/jquery-ui.js\"></script>
    <script src=\"http://skapps.webhop.net/incl/w2ui/w2ui-1.2.js\"></script>
    <link rel=\"stylesheet\" href=\"http://skapps.webhop.net/incl/w2ui/w2ui-1.2.css\" />
    </head>
    <body>
    <div id=\"MyList\"></div>
    <script>
    $(function ()\{
    	$(\'#MyList\').w2grid(\{
    {#jsonval}
    	\});
    
    var winheight = $(window).height();
    $(\'#MyList\').css(\'height\', winheight-20);
    document.title = \'My List\';
    
    \});
    
    </script>
    </body>
    </html>
    ", "Global")
        set(#jsonrec, $nothing, "Global")
        set(#jsonval, $nothing, "Global")
        clear list(%JSONLISTclean)
    }
    
     

    I know that this is a bit old, but what is it about?

  4. I'd be willing to pitch in on this project as I'll be wishing to develop much the same thing in a professional manner for my growing product line in the next six months. But I'll be honest, I'm pretty anal when it comes to writing the code to make it clean, and understandable. Proper use of local, global variables and constants. (Hmmm what the heck are constants you ask?) ;)

     

    Frank

  5. You have to make sure that you do package your bot properly with an installer such as actual installer. If you professionally package up things, most can be ignored and programming in ubot isn't a bad thing. Some folks think it cheapens things but I totally disagree. It's the programmers in the past that put out rubbish code from ubot that's the issue.

  6. For the time being my work around is to have the customer uninstall and re-install the software I built and packaged with actual installer. I've added a command line in like mentioned here but had it remove the license.lic file on uninstall. That permits the person to clear out the license info and than start fresh. A bit backwards - again, it would be better to provide a button on the error message stating something like 'Enter New License?' and it would automatically clear the license and try again.

     

    Second, I've noticed it takes a good 10 seconds to have the app fire up. Users will click multiple times. Any thoughts there?

     

    Frank

  7. Thanks for the input CJ, but I'm wondering about files that are one directory deeper. I keep most of my support files in a support_files directory inside the main program directory.

     

    But I think I've found a bug. When I use a license that is already used, it comes up with an error, 'Invalid license. Allowed number of activations has been exceeded.' which is good but there's no easy way to stop that message from coming up and put in a new license.

     

    Now, if there was an option to enter a new license when it failed - that's a different story.

     

    Frank

    • Like 1
  8. Meter, do you think there is a way to have the licensing software not allow a program to start if they change the name of the exe file? I want to limit execution to one process on one machine and I cannot find a way to stop a process from starting if the name is changed. That way they can get around some of my limitations by making three files with different names and running all three. And the software doesn't bulk.

     

    Frank

×
×
  • Create New...