Topic: Subtle clipboard cut&paste question. (1 of 15), Read 54 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Sunday, April 01, 2001 02:34 PM

Hi,
I have no problem cutting a block to the clipboard and pasting the result back to my file, provided that I am in insert mode.

However, if I am in overwrite mode, I need an additional condition. This additional condition is that the block has to be horizontal. If the block is a columnar block ,then trying to paste to the file I get an "overwrite mode .." error message.

If this is intentional, I would appreciate an enhancement that would allow me to cut and paste arbitrary blocks to the clipboard.

Thanks,

-peter rejto.

 


Topic: Re: Subtle clipboard cut&paste question. (2 of 15), Read 54 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Monday, April 02, 2001 11:12 AM

At 02:34 PM 4/1/2001, you wrote:
>However, if I am in overwrite mode, I need an additional condition. This additional condition is that the block has to be horizontal. If the block is a columnar block ,then trying to paste to the file I get an "overwrite mode .." error message.

Sorry, but I do not know what you mean by "horizontal" block. Please specify the full error message. Please always specify what version of VEDIT you are running. Please specify what function you are trying to use - there are at least four different "paste" functions in VEDIT. In this case, please also specify the value of {CONFIG, File handling, File type}.

The on-line help topic "Read-only and Overwrite-only modes" may help you
understand what is going on.

My "guess" is that you are editing a binary file, e.g. the "File type" is
set to 64.

Ted.

 


Topic: Re: Subtle clipboard cut&paste question. (3 of 15), Read 53 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Tuesday, April 03, 2001 01:06 AM

Thanks Ted for the immediate reply.

Here are my parameters: Vedit 5.20.5 /2.19.01
I forgot to define a "horizontal bloc" as bloc whose height is 1-column.
I used the

{Edit, cut to clipboard}

menu command with the following settings:

{Config, File Handling, Overwrite-only mode=1; File-type=144; Record header size=193}

I repeat: if the block is 1-column high, then
I can cut it to the clipboard and can paste it from the clipboard to a different location in the file. However, if I have a 2-columns by 2-rows block I can not paste it from the clipboard I get an Overwrite_only mode error message.

I hope that this time I have given you all the relevant parameters.

Thanks again,

-peter.

 


Topic: Re: Subtle clipboard cut&paste question. (4 of 15), Read 49 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Tuesday, April 03, 2001 02:08 AM

Peter,

now I tried to reproduce your problem too.
But it's really hard to understand what your problem exactly is...

After some experiments I think I've found it:

If the __columnar__ block you are trying to paste into the buffer
would write after the End_Of_Buf VEDIT warns you that this is not
allowed in overwrite only mode and cuts the block.

If there is enough "space" for pasting without enlarging the file size
there is no error message.

At least that is working fine while using columnar blocks for copying
and also for pasting.


[But Ted:]
Stream blocks (and pasting from clipboard is always pasting as stream
block) behave NOT correct (IMHO) here.

If I copy a block into the clipboard or a register and paste it as
stream block into the edit buffer (while in binary/overwrite only
mode) at a cursor position near the end that forces VEDIT to write
past the End_Of_Buf VEDIT does exactly that....
And alters the file size!
That's not correct in this mode I think.
The behaviour should be the same like with columnar block pasting:
Warning and cutting.

Christian

 


Topic: Re: Subtle clipboard cut&paste question. (6 of 15), Read 50 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Tuesday, April 03, 2001 03:01 AM

Christian,
Thanks for your experiments with my problem.
This is what I did: I have a .dbf file with 200 records in it. The Vedit DBASE.VDM macro sets the File_type to 144. I wish to move the records 1-column to the right. I move the cursor to line 2, column 1 and use the

{Block, Set column marker}

menu command to start marking a 200 x 143 columnar block. Then I use it again to finish marking. Then

{Edit, Cut to clipboard}

and finally, after moving the cursor to column 2, line 2;

{Edit, Paste clipboard columnar black}.

This does not work for me. Note that I did subtract 1 from the record length, so I did not alter the file size.

However, if I do the same experiment with smaller blocks then it works.

I shall do some more experiments, I just wanted to give you a progress report.

Thanks again Christian.

-peter.

 


Topic: Re: Subtle clipboard cut&paste question. (8 of 15), Read 47 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Tuesday, April 03, 2001 03:10 AM

Ooops, Some seconds ago I sent you that too. :-)

Strange with that "large" blocks.

Be careful not to mark-column-block one line too many! The cursor must
be IN the last record line and not in the empty last line !!!


Christian

 


Topic: Re: Subtle clipboard cut&paste question. (9 of 15), Read 47 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Tuesday, April 03, 2001 03:19 AM

Yes, with 144x200 it seems to be possible (sometimes) to replicate the
error.

Unfortunately I don't have more time now. Maybe later.


Christian

 


Topic: Re: Subtle clipboard cut&paste question. (10 of 15), Read 47 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Tuesday, April 03, 2001 03:26 AM

No, I think it's a handling problem. Now I can't reproduce it.
All works fine with 200x144.

I give up. ;-)


Christian

 


Topic: Re: Subtle clipboard cut&paste question. (11 of 15), Read 43 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Tuesday, April 03, 2001 09:29 AM

At 02:08 AM 4/3/2001, you wrote:
>If I copy a block into the clipboard or a register and paste it as
>stream block into the edit buffer (while in binary/overwrite only
>mode) at a cursor position near the end that forces VEDIT to write
>past the End_Of_Buf VEDIT does exactly that....
>And alters the file size!

This is intentional so that you can add records to the end of a file. Even when you are in "overstrike" mode, you can insert characters at the end of a file.

Ted.

 


Topic: Re: Subtle clipboard cut&paste question. (13 of 15), Read 46 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Tuesday, April 03, 2001 10:01 AM

>This is intentional so that you can add records to the end of a file. =Even when you are in "overstrike" mode, you can insert characters at the =end of a file.

o.k. I should have known. ;-)


Christian

 


Topic: Found 'Paste columnar clipboard' command (5 of 15), Read 47 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Tuesday, April 03, 2001 02:25 AM

Ted,
Rereading your answer, I just found the

{Edit, Paste columnar clipboard}

menu command. This seems to solve most but not all of my problems. Specifically, it seems that now I can cut and paste "small" blocks to and from the clipboard. I just don't know what "small" means.

I also looked up this command on the online help. It recommends using the Vedit text registers for such operations. This is what I tried in the first place. However, when I edit a fixed length file Vedit did not allow me to cut and paste any blocks. It gave an "overwrite-only" error message. I thought this was on purpose; to prevent me from accidental overwrites. If I do not hear from you to the contrary, I assume that this inrpretation of mine is correct.

Incidentally, my original problem is this. I have a .dbf file which has 200 records. I would like to move these records to the right by 1-column.

Thanks again,

-peter.

 


Topic: Re: Found 'Paste columnar clipboard' command (7 of 15), Read 46 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Tuesday, April 03, 2001 03:06 AM

I'm not Ted, but:

you wrote:
>{Edit, Paste columnar clipboard}
>menu command. This seems to solve most but not all of my problems. =Specifically, it seems that now I can cut and paste
>"small" blocks to and from the clipboard. I just don't know what "small"= means.
>[...]

Read my other answer in thread "Subtle clipboard cut&paste question."
(Regarding file size)

>Incidentally, my original problem is this. I have a .dbf file which has =200 records. I would like to move these records to the right by 1-column.

1) Column-Block-mark all lines ___except___ the last column.
2) Block-Move to Register (NumPad-)
3) Set cursor at 1st record and 2nd column
4) Block-Insert Register (NumPad*)

Voilá. (Off course with loss of the last column. Otherwise it's not
soo easy, but possible.)

HTH

Christian

 


Topic: Re: Found 'Paste columnar clipboard' command (12 of 15), Read 44 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Tuesday, April 03, 2001 09:46 AM

At 02:25 AM 4/3/2001, you wrote:
>menu command. This seems to solve most but not all of my problems. Specifically, it seems that now I can cut and paste "small" blocks to and from the clipboard. I just don't know what "small" means.

"Small" is a vestige from previous versions. VEDIT now supports huge clipboards.

>I also looked up this command on the online help. It recommends using the Vedit text registers for such operations. This is what I tried in the first place. However, when I edit a fixed length file Vedit did not allow me to cut and paste any blocks. It gave an "overwrite-only" error message. I thought this was on purpose; to prevent me from accidental overwrites.

You can eliminate the "Overwrite-only" message by setting {CONFIG, File handling, Overwrite-only mode} to "0". You can then insert characters into fixed-length-record and binary files; but you better know what you are doing.

>Incidentally, my original problem is this. I have a .dbf file which has 200 records. I would like to move these records to the right by 1-column.

You should have mentioned this first. This cannot easily be done; partly because it is meaningless.

You stated that the .DBF file has a record length of 144. I could write a macro which adds one empty column to it. It would then have a record length of 145. However, without making complex changes to the header, it would be a corrupted file and would no longer load into the database program. Since this is true of all fixed-length-record and binary files, there is no reason for VEDIT to make it easy to corrupt such a file.

Incidentally the macro to add one column to the beginning of each record would be:
BOF()
while (! At_EOF) {
Ins_Char(' ')
Char(144)
}
Config(F_F_TYPE, Config(F_F_TYPE)+1 )

Sometimes it is useful to convert a fixed-length-record file into a text file which can then be edited without limitations. Use the {BLOCK, Convert newlines, CONVERT macro} function for this.

Ted.

 


Topic: Found 'Paste columnar clipboard' command (15 of 15), Read 40 times
Conf: VEDIT Macro Language Support
From: Pauli Lindgren
Date: Friday, April 06, 2001 05:32 AM

>
>Incidentally, my original problem is this. I have a .dbf
>file which has 200 records. I would like to move these
>records to the right by 1-column.

If what you are trying to do would work, I don't think it would move the records to the right. It would move column 2 left to column 1, column 3 left to column 2 and column 1 right to column 3. Other columns would not be moved.

What you should do is to cut the last column and paste it at the first column.

But I don't see why you should use clipboard for that. Instead, do the following:

1. Move cursor to line 2 at the last column and mark begin of columnar block.
2. Move cursor to the last line at the last column and mark end of the columnar block.
3. Move cursor to the first column of line 2.
4. Select Block -> Move to cursor (Alt-F9).

-- Pauli

 


Topic: Subtle clipboard cut&paste question. (14 of 15), Read 43 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Tuesday, April 03, 2001 07:04 PM

Thanks Ted,
1. >Sometimes it is useful to convert a fixed-length-record file into a text file which can then be edited without limitations. Use the {BLOCK, Convert newlines,
CONVERT macro} function for this.

Indeed, this is extremely useful for me! I can import a properly formatted text file into my spreadsheet, there I can adjust the cell columnwidth and finally I can export
the spreadsheet file into a .dbf file.
At the same time, I prefer to do all of the work in Vedit and this leads me t the next item.

2. I really appreciate the macro that you have written for me. I understand that it creates a corrupted file, inasmuch as the header information still refers to the old record length. At the same time, I feel comfortable of doing this update manually myself. The reason why I feel comfortable is that I have studied the superb distribution file DBASE.VDM. A big thank you to Freed for writing it! Your macro will allow me to change filed and record sizes using Vedit. At
present I do this via importing and exporting it to a spreadsheet.

3. >You can eliminate the "Overwrite-only" message by setting {CONFIG, File
handling, Overwrite-only mode} to "0". You can then insert characters into
fixed-length-record and binary files; but you better know what you are doing.

Thanks for alerting me to this fact. I tried
and I have really corrupted my files in no time. I shall stay away from it.

4.>You should have mentioned this first. This cannot easily be done; partly because it is meaningless.

I forgot to tell you that the last column contains no useful information, so I am overwriting it.

5. Finally, I would like to brag about my phone directory file. Specifically, I can adjust the length of the idividual fields,
via importing and exporting it to a spreadsheet. I have surfed the net and I could not find any phone software which does this. I have been working on this problem for some time. I started out with Procomm, which has been bought out by Symantec. It is a fine product but it is not aimed at automating voice calls. From my point of view another negative feature is that the Procomm phone directory is not a .dbf file; at least it was not in Version 2.1, which I bought. I can use Vedit to edit it, after manually entering the record and header sizes. Then I looked at
Bitware, which does use a .bdf file. It was a great relief that DBASE.VDM did put a readable Bitware phone directory on the screen. Again, the Bitware manual states explicitly that the size of the various fields can not be changed. Finally, thanks to your and Christian's kind help I should be able to edit .dbf phone directories within Vedit.

Thanks again,

-peter.