Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jan-Erik Lärka

Pages: 1 ... 13 14 [15] 16 17 18
211
Applications / Re: Apache OpenOffice 4.1.1 RC3
« on: December 10, 2014, 04:17:42 pm »
My main basic macro update all tabs, data pilotes and add conditional formatting as expected.
The other Basic macro can't export the charts as png-images (but on other platforms).
What should I do?

Regards,
//Jan-Erik




212
Applications / Re: Apache OpenOffice 4.1.1 RC3
« on: December 02, 2014, 12:46:06 pm »
Where do I change macro security level in Apache OpenOffice 4.1.1?
...
//Jan-Erik

Never mind, found it in another file :-)
I'll rewrite my script.
//Jan-Erik

213
Applications / Re: Apache OpenOffice 4.1.1 RC3
« on: December 02, 2014, 09:05:55 am »
Where do I change macro security level in Apache OpenOffice 4.1.1?
I know it's not possible "inside" OpenOffice", but should be possible in some configuration file or registry.

In 3.2 it was possible to add some xml code to *common.xcd". I wrote a rexx script that did (and does) it nicely, though only in 3.2 as it seem to have changed in 4.x?
I need to export multiple Charts as png images (every Friday night) with code I've written.

//Jan-Erik

214
Utilities / Re: Print to Email.....sort of...
« on: October 24, 2014, 08:49:37 am »
You should use some REXX script to do what you want. We can perhaps post our partial solutions (functions) here to each task that has to be handled to create the e-mail(s).



Can we assume that the file ( clients.txt ) look like?
12345{TAB}John Doe{TAB}john.doe@gmail.com
67890{TAB}Jane Doe{TAB}jane.doe@gmail.com
13579{TAB}Joe Doe{TAB}joe.doe@gmail.com
24680{TAB}Jill Doe{TAB}jill.doe@gmail.com

Let's begin with some of the code for you all to add your suggestions to.
Code: [Select]
/* Script to send PDF-files to clients */
path = 'C:\invoices'
client_email = 'C:\invoices\clients.txt'

/* Load RexxUtil Library */
IF RxFuncQuery( 'SysLoadFuncs' ) THEN
DO
    CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
    CALL SysLoadFuncs
END

/* Find the files to send */
IF( SysFileTree( path'\CLIENT*.PDF', 'filename.', 'FO' ) THEN
DO i = 1 TO filename.0 /* Go through each found filename */
  PARSE UPPER VALUE filename.i WITH 'CLIENT'clientno'INVOICE'invoiceno'.'extension

  /* Find the email address based on client number (clientno) */
  /* ... add the call to function here (instead of this comment) ... */

  /* Create the e-mail with PMMSend */
  /* ... add the call to function here (instead of this comment) ... */
END
RETURN rc

/* Find the email address based on client number (clientno) */
/* ... and write the actual function here (instead of this comment) ... */

/* Create the e-mail with PMMSend */
/* ... and write the actual function here (instead of this comment) ... */


215
Applications / Re: Regina REXX vs. OS/2 REXX
« on: October 03, 2014, 01:22:57 pm »
I do lots of stuff in classic REXX.  Admittedly on OS/2 I use the built-in REXX support, it just plain works.

...

So true all you wrote.

It's fairly easy to write a REXX extension library that can use C libraries, but someone has to do it.
It's even easier with a String class that can handle and convert from/to numbers and strings.

I dislike Python because of the strict and rigid indention rules.
===

OS/2 REXX is integrated with the os.
Regina is a separate executable.

Regina lack something I've come across and use in Classic REXX under OS/2-eCS.
Code: [Select]
/* "Main" entry of script */
stem.0 = 2
stem.1 = "Hello"
stem.2 = "World"
my_array.0 = 4
my_array.1 = "Say"
my_array.2 = "hi!"
my_array.3 = "to"
my_array.4 = "everyone"
my_variable = "Some text"
dont_expand_variable = "Exposed variable"
expand_variable = "stem. my_array. my_variable"
dont_expand_variable = "Hello!"
RETURN rexx_function_name()

/* Function below */
rexx_function_name PROCEDURE EXPOSE (expand_variable) dont_expand_variable
SAY expand_variable
SAY dont_expand_variable
DO i = 1 TO WORDS( expand_variable )
  check_variable = SUBWORD( expand_variable, i, 1 )
  IF RIGHT( check_variable, 1 ) = '.' THEN
    /* Assume this is a stem (array of accessible values).*/
    DO j = 1 TO VAL( check_variable'0' )
    /* Will output the text set in "main" */
      SAY VAL( check_variable''j )
    END
END
RETURN 0

The above code work in OS/2 Classic REXX and output "stem. my_array. my_variable" AND you can access the contents of stem.0 , stem.1, ... stem.N and my_array.0, my_array.1 ... my_array.N and my_variable just as with "dont_exand_variable" that will output the text "Exposed variable".

The same goes for parsing...
In OS/2 Classic REXX you can
...
/* Example code for PARSE below */
delimiter = "/"
text_2_parse "this is an example of text/code to split on the character with / into smaller parts."
DO WHILE POS( delimiter, text_2_parse ) > 0
  PARSE text_2_parse WITH pre(delimiter)test_2_parse
  SAY pre
END
SAY test_2_parse
/* end of example */
Would output:
this is an example of text
code to split on the character with
 into smaller parts.
======
ADDRESS in Regina is something I like that is very powerful.

216
Internet / Re: Firefox for eCS (OS/2) 24.8.1 Beta2 using very high CPU.
« on: October 03, 2014, 07:46:58 am »
Do you guys have REIPL=ON in your config.sys? I haven't had a random reboot in ages and seldom get traps, the very occasional trap 3 in JFS and when I marked SeaMonkey and Thunderbird to use high memory Thunderbird became unstable, even causing a trap 0. I unmarked Thunderbird and the system became stable.

Nope, just a plain eCS v2.2 Beta just reinstalled.

217
Internet / Re: Firefox for eCS (OS/2) 24.8.1 Beta2 using very high CPU.
« on: September 30, 2014, 08:27:13 am »
Hello,

both my AMD Phenom Quad Core computer and my Sony Vaio Intel i3 reboot like that.
Everything goes black instantly and then BIOS info show up as it reboot.
It happen with JAVA applications such as JDownloader as well.

218
Hardware / Re: Webcam Support for OS/2 and eCS!!
« on: August 11, 2014, 12:26:31 pm »
It is possible to run weblook.exe and to replace webview.exe with a rexx procedure that obtains the individual mjpeg frames and to convert these into ordinary jpeg files by adding huffman code tables to them. If you want to go that route then I can append an example that I use myself for testing purposes.

Yes, that is an option to.
 
C/C++ examples how to use webcam support?
Would be nice to add an option to the rxImgSize 1.04.dll for rexx to take individual snapshots.

result = rxImgCapture( window_name[, left_coordinate[, bottom_coordinate[, right_coordinate[, top_coordinate[, save_as_path_and_filename ] ] ] ] ] )

Where "window_name" would be extended with e.g. "WEBCAM" (or ... suggestion?)

219
Hardware / Re: Webcam Support for OS/2 and eCS!!
« on: August 09, 2014, 10:04:58 pm »
I'd like to add support for webcam into my rexx library... :)

The source code example has been written in turbo assembler though.

//Jan-Erik

220
Hardware / Re: Webcam Support for OS/2 and eCS!!
« on: August 09, 2014, 10:05:33 am »
I have concluded :) the development and testing of my Webcam Support for OS/2 (and eComStation).  I have put it as WebSee10.zip and its source code as WebSee10s.zip both on my website and on hobbes. I have also put the latest version of my USB Resource Manager as usbres01.zip there.

I like to thank everyone involved.

And I would like to add my Thank you to the previous ones.
I can now take images with my Sony Vaio.  8)

After a few seconds, it does however show a message (regardless if I take a screenshot or not):
=============
UvcView 0!0
_______________
[00000280] Obtain Thread error!
_______________
[  Cancel  ]
=============

221
Hardware / Re: Webcam Support for OS/2 and eCS!!
« on: July 01, 2014, 11:12:53 am »
Hello,

I tried it with my Sony Vaio Notebook and the green led turned on...

How far away is a driver that one can try?

//Jan-Erik Lärka

222
Programming / Re: rexx Screen Capture
« on: May 18, 2014, 05:45:02 pm »
Hello,

was just reading how to do it .

Thank you for helping me out! :-)

223
Programming / New Version to Capture Images of the Screen with Rexx
« on: May 17, 2014, 11:47:08 pm »
Hello,

I've completed the rewrite of the library ( RxImgSze 1.03 ) to capture the screen and/or parts of it and save as an image (jpg, png, bmp etc.).
The library can also scale images and reduce/increase the number of colors of images of various file formats (jpg, png, gif, bmp etc.).
See the included hlp-file for information how to use the rexx library.
____
The script html2hlp interpret a html file to create a help file. ( Basic HTML 3.2 and HTML 4.0 )
See the example HTML file and "readme"
____
The included debug application help you debug libraries (.dll) for rexx
See "readme" for information

//Jan-Erik

Documentation corrected May 18, 2014, 10:10 CET

224
Programming / Rexx script to enable OpenOffice Macro support!
« on: April 16, 2014, 11:28:30 pm »
Hello,

I've used OpenOffice.org for quite some time and consider myself as a power user when it come to designing spreadsheets, so the disabled support for macros in OpenOffice.org has been annoying to say the least

I today found the relevant post how to enable marco security and now written a rexx script and tested it successfully. You can test and use it as well!

You need a macro in your spreadsheet to see that it actually work, so follow the steps below to add the relevant but very simple code to your spreadsheet

Regards,
//Jan-Erik

OpenOffice.org Calc
Menu:Tools -> Macros -> Organize macros -> OpenOffice.org Basic...
Window:OpenOffice.org Basic Macros
Area:Macro from
Treeview:[-]<Select your spreadsheet>
Mark:[-] Standard
Button:[  New  ]
Window:New Module
Field:Name:
Keyboard:GetSheetName
Button:[  OK  ]
Window:<Your spreadsheets name> - OpenOffice.org Basic
Cut & Paste:
Code: [Select]
Function GetSheetName( i )
On Error Goto trap
GetSheetName = ThisComponent.Sheets(i-1).Name
Exit Function
trap:
GetSheetName = erl()
End Function
Menu:File -> Save
Menu:File -> Close
Spreadsheet:Select a cell
Keyboard:=getsheetname(3)
Keyboard:Enter
As you press enter the cell will show #VALUE
Save the spreadsheet and run the script below and set it to 1
Higher value mean higher security but also more restrictions
Reopen the spreadsheet
Allow it to run the macro
You should now see the name of the third tab in your spreadsheet in the cell.
====

You will see a window that ask if you want to enable macros if you set the security level to 1.
You can rerun this script if you like to increase or decrease the security level.
Code: [Select]
/*
 * Filename: OOorgMacro.cmd
 *   Author: JAN-ERIK
 *  Created: Wed Apr 16 2014
 *  Purpose: Add macro security tag to configuration file to be able to run Macros in the OS/2 and eComstaiton version of OpenOffice.org
 *  Changes:
 */

/* Load RexxUtil Library */
IF RxFuncQuery('SysLoadFuncs') THEN
DO
    CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
    CALL SysLoadFuncs
END
CALL SysCls
CALL LINEOUT 'STDERR', 'OpenOffice.org for OS/2 and eComstation'
CALL LINEOUT 'STDERR', "doesn't contain a utility to allow you to enable macros"
CALL LINEOUT 'STDERR', ''
CALL LINEOUT 'STDERR', 'This script will attempt to enable macro security for you.'
CALL LINEOUT 'STDERR', ''
CALL LINEOUT 'STDERR', 'Please do note that you should be aware that macros may'
CALL LINEOUT 'STDERR', "be harmful so don't open files from unknown sources or"
CALL LINEOUT 'STDERR', 'files that may contain macros.'
CALL LINEOUT 'STDERR', ''
CALL LINEOUT 'STDERR', "Don't blame the author of this script for any harm caused!"
CALL LINEOUT 'STDERR', ''
CALL CHAROUT 'STDERR', 'Do you want to continue (yes/No)? (N by default) '
PARSE PULL answer
IF TRANSLATE( LEFT( answer, 1 ) ) <> 'Y' THEN RETURN 0
level = ' '
DO WHILE \DATATYPE( level, 'W' )
    CALL LINEOUT 'STDERR', ''
    CALL LINEOUT 'STDERR', 'Valid values are: 0 - the lowest; 1 - the lower; 2 - default; 3 - the highest'
    CALL LINEOUT 'STDERR', ''
    CALL CHAROUT 'STDERR', 'Specify the security level to use (4 and above to abort): '
    PARSE PULL level
    IF level = '' THEN level = 2
    IF level < 0 THEN level = ' '
    IF level > 3 THEN RETURN level
END

newln = D2C(10)
add.1 = '<node oor:name="Security">'
add.2 = '  <node oor:name="Scripting">'
add.3 = '   <prop oor:name="MacroSecurityLevel" oor:type="xs:int">'
add.4 = '    <value>'||level||'</value>'
add.5 = '   </prop>'
add.6 = '  </node>'
add.7 = '</node>'
add.8 = '</oor:component-data>'
add.0 = 8

CALL CHAROUT 'STDERR', '.'
home_dir = VALUE( 'HOME',, 'OS2ENVIRONMENT' )

IF SysFileTree( home_dir||'\*common.xcu', 'file.', 'SFO' ) = 0 THEN
DO i = 1 TO file.0
    f_size = STREAM( file.i, 'C', 'QUERY SIZE' )
    IF f_size = 0 THEN ITERATE
    input = CHARIN( file.i, 1, f_size )
    CALL STREAM file.i, 'C', 'CLOSE'
    PARSE VALUE input WITH pre(add.8).
    PARSE VALUE pre WITH pre(add.1).
    DO j = 1 TO add.0
        CALL CHAROUT 'STDERR', '.'
        pre = pre||add.j
        IF j < add.0 THEN
            pre = pre||newln
    END
    IF SysFileDelete( file.i ) = 0 THEN
        CALL CHAROUT file.i, pre
    CALL CHAROUT 'STDERR', '.'
END

225
Programming / Re: Schedule Wake Up with DragText 3.x
« on: February 07, 2014, 07:56:49 am »
Quote
How do I set the repeat interval with the information above, or...?

I don't know how to do what you want to do, but I wouldn't even think about using DragText to do it. Dragtext is good for consistently doing something, on a repeatable basis. That is, "set and forget". It seems that you want to do something different, on different days (and probably add more exceptions for holidays etc.). If I was going to do that, I would just use REXX to do it. You already have the basic script, just add a command to start PM123, with a playlist, or URL, at the appropriate time.

Set and forget is exactly what the script is supposed to do and does, my weeks look all the same.
REXX is a wonderful scripting language, but in itself lack a scheduler.
The thing is that I don't want to recreate the program objects by hand for every test installation and new beta release of eCS that I try.  ;)

If there's a way to add it, then there's a way to remove the schedule as well, delete the program object or rewrite/update it, so it shouldn't be a problem once I get the info to create similar Objects for other use.

My "plan" would be to use PM123, to tune in an internet radio station, which can be done with a simple command. You could also use a local playlist for your own music files. Then, I would kill PM123 after a timeout period (1 or 2 hours), and have a way to tell it to close earlier. You may also want a "Sleep button".

Ok, that is a good plan, especially if one can hug the pillow for an hour or two.

Wireless small touch screen next to the bed as Photo Frame (screen saver of eCS) + speakers.
A giant "One Button Snooze/Sleep"-skin for PM123

My "problem" is that I really don't want to have a computer in my bedroom. What I would really like to have, is an FM transmitter, that could be attached to my main computer, so I could listen using my existing clock radio (which is actually a piece of junk).

That would be just great to have, because my clock radio is just as bad.
Show time, play music and got a sleep/snooze button.

I have also looked at the BOSE radio, that has a WiFi adapter in it. Apparently it can use a normal URL, or it can use a local system, if it has an appropriate program (Mediatomb will probably do it). I am not sure how programmable the radio is, as far as changing the wake up time for special days.

Just some thoughts...

Great thoughts!

Pages: 1 ... 13 14 [15] 16 17 18