Fpga disabled code using space on a FPGA
I have a endable/disable diagram for emulation a FIFO during emulation mode. see atached picture.
Does the disabled code use space on an FPGA ( I have not enough space on my 3Mgate FPGA for my program)
I ask this because in some other part of the labview code I had compiling error (in VHDL code) in disabbled laview code.
So it looks like if the disabled code takes space on the FPGA, is this the case?
Frank
Attachments:
FIFO emulation.GIF 10 KB
The code in disable structure doesn't take space on the FPGA, I use it often and it works.
But in your case, i guess you should disable the for loop too. Because you have an empty loop that have an auto-index activated, and since this part is not disabled, it takes space on your FPGA.
Hope this helps,
Xavier
Similar Messages
-
What are malicious scripts and what causes them? Over the years hackers found it hard to trick people into visiting suspicious sites so they're now targeting legit sites and using them to infect unknowing customers. In most cases an FTP account's password is obtained through key logging malware, then legit website files are modified to distribute the malware and gather more passwords. If your PC has been infected with one of these trojans, your bank account, email accounts, and FTP accounts may no longer be secure. * What to do if you find malicious scripts 1. Use the following online vulnerability scanner and ensure your software is up-to-date: http://secunia.com/vulnerability_scanning/online/?task=load 2. Download antivirus and fully scan your PC for malicious files. Here are some free online scanners: http://housecall.trendmicro.com/ http://www.bitdefender.com/scan8/ie.html http://www.kaspersky.com/virusscanner http://support.f-secure.com/enu/home/ols.shtml 3. Update all passwords that may have been obtained. Do not use old passwords, generate new ones. 4. Upload older versions of the files or contact support for assistance removing the malicious scripts. * Prevention - Ensure you use the latest browser version - Disable javascript - Use the firefox addon noscript - Download and install some free antivirus software, make sure it stays updated - Use http://www.avg.com.au/index.cfm?section=avg&action=onlinescan to test suspicious links you are given in emails or find online. If you are seeing a Google Attack Page when you visit the site, use the steps below to request that Google reindex the site and hopefully remove this block. This excerpt was copied from the URL below, and provides step by step instructions to request a delisting. http://www.google.com/support/webmasters/bin/answer.py?answer=45432 Once you have reviewed your site and are sure it is clean, you can can submit a request for review. Note that you'll need to verify site ownership before you can request a site review. 1. Sign in to Webmaster Tools with your Google account. 2. On the Dashboard, select the site you want. 3. On the Overview page, click Request a review and follow the instructions. Best regards, Tyler Evans Network Security Administrator HostGator.com LLC http://support.hostgator.com
Thank you.
I also had tried other means of getting answers and got an even more specific answer on just how to do this. Below is the link to the actual knowledgebase article giving specific instructions since there are some files that need to be on the Palm and some on the card, etc.
http://support.laridian.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=380&ratingconfirm=...
I emailed Zondervan to see if they might be able to direct me to a downloadable manual. The referred me to laridan.com who now supports their software.
I followed the instructions, taking into account some things that were already where they needed to be, hot synced it and it seems to be working fine with 7.8 M free space on my Palm which I trust is enough for my other very large applications.
Thanks for your help!
Post relates to: Tungsten E2 -
How to find out the used space and free space in the DB for attachments
Hi,
In CRM 5.2 web UI, we can save a transaction by saving attachments like work documents or text files.
Could someone help me find out the used space, free space, maximum capacity on the CRM DB for these attachments.
Thanks & Best Regards,
Ramesh.Hi,
check with below table
TNAPR --- Processing programs for output
and NACE Transaction code
NACE -- out types
Regards,
Madhu -
How can i write the below code using "For all entries"
Hi
How can we write the below code using "for all entries" and need to avoid joins...
Please help
SELECT aaufnr aobjnr aauart atxjcd a~pspel
agstrp awerks carbpl cwerks
INTO TABLE t_caufv
FROM caufv AS a
INNER JOIN afih AS b
ON aaufnr = baufnr
INNER JOIN crhd AS c
ON bgewrk = cobjid
AND c~objty = 'D'
WHERE ( a~pspel = space
OR a~txjcd = space
OR NOT a~objnr IN
( select OBJNR from COBRB AS e
WHERE objnr = a~objnr ) )
AND a~werks IN s_plant
AND a~auart IN s_wtype
AND NOT a~objnr IN
( select OBJNR from JEST AS d
WHERE objnr = a~objnr
AND ( dstat = 'A0081'OR dstat = 'A0018' )
AND d~inact 'X' ).
Reward points for all helpfull answers
Thanks
Ammi.Hi,
SELECT objnr objid aufnr
from afih
into table t_afih.
SELECT objnr
from JEST
into table t_JEST
where stat = 'A0045'
OR stat = 'A0046'
AND inact 'X'.
SELECT objnr
from COBRB
into table t_cobrb.
SELECT arbpl werks objid objty
from crhd
INTO table it_crhd
FOR ALL ENTRIES IN it_afih
WHERE objty eq 'D'
AND gewrk = it_afih-objid.
SELECT aufnr objnr auart txjcd pspel gstrp werks aufnr
FROM caufv
INTO table t_caufv
FOR ALL ENTRIES IN it_afih
WHERE aufnr = it_afih-aufnr
And pspel = ' '
AND txjcd = ' '
ANd objnr ne it_crhd-objnr
AND auart in s_wtype
AND werks in s_plant.
AND objnr ne it_jest-objnr.
dont use NE in the select statements, it may effect performance also. Instead use if statements inside
loops.
loop at t_caufv.
read table it_chrd............
if t_caufv-objnr ne it_chrd-objnr.
read table it_jest..........
if if t_caufv-objnr ne it_jest-objnr.
(proceed further).
endif.
endif.
endloop.
hope this helps.
Reward if useful.
Regards,
Anu -
Google has disable the use of the api key
I've setup a google static map using the api key v3 in this site www.pequenonim.es.
Problem is Firefox is giving an error message:
" Google ha inhabilitado el uso del API de Google Maps para esta aplicación. La clave proporcionada no es una clave de API de Google válida, o no está autorizada para la versión 3 del API de JavaScript de Google Maps en este sitio. Si eres el propietario de esta aplicación, puedes consultar cómo se obtiene una clave válida aquí: https://developers.google.com/maps/documentation/javascript/tutorial#api_key"
Something like Google has disabled the use of the API for this application. The key is not valid or is not authorized for version 3 of the api of javascript in this site.
Measurements already taken:
API v3 and API v2 enable on api code panel
Reset firefox
Clean cookies and cache of firefox.
Map actually works on Chrome and IE10.Is it the map on the bottom of the main page? It works for me in Firefox 24 on Windows 7 from California.
You may want to look at the code in Firefox's source viewer, starting a few lines below id="bottom2", as there are some stray <html>, <head>, and <body> tags that suggest a template or plugin isn't fully compatible with your page. -
Finding the size of db and size of used space
Greetings all good people.
Can you please help me find out about 2 database information?
One, I want to find out the size of a database =size of physical files.
and the size of data which is the size occupied in physical files.
We are about to start a new project and there is a table on the database but it is empty.
We want to be exporting data into this table but we want to make sure that there is enough space on the db before we start populating the table with data.
I believe the code below just gives me the size of the database.
select (bytes/1024/1024) as total_gigs from dba_segments where owner='BELL' and segment_name='$TABLE_NAME
But I want to know the total size of the database and how much size has been used already, much the same as you would want to know the size capacity of a hard drive and how much of the size has been used.
Sorry if my request is confusing.
Thanks a lot in advancedb size can be found out
select sum(bytes)/1024/1024/1024 from dba_data_files ;
and size of data is -- in the datafiles
select sum(bytes)/1024/1024/1024 from dba_segemnts ;
You can find out by below query .. the tablespace sizes -- would be DBSIZE
used space -- would be the actual occupied space.
select t.tablespace, t.totalspace as " Totalspace(MB)",
round((t.totalspace-nvl(fs.freespace,0)),2) as "Used Space(MB)",
nvl(fs.freespace,0) as "Freespace(MB)"
from
(select round(sum(d.bytes)/(1024*1024)) as totalspace,d.tablespace_name tablespace
from dba_data_files d
group by d.tablespace_name) t, (select round(sum(f.bytes)/(1024*1024)) as freespace,f.tablespace_name tablespace
from dba_free_space f
group by f.tablespace_name) fs
where t.tablespace=fs.tablespace (+)
order by t.tablespace -
[Bug] Photoshop CC,Layer Group add vector mask and disable it, use path selection tool click canvas, always crash!!! Please help me!
The sample psd file(158KB):
http://doc.aoyea.com/ps_cc_bug.psd
My Computer configuration:
SONY VAIO CA100 Notebook、Intel Core I5 2410 CPU、16GB RAM、AMD Radeon 6600M(1G RAM)、Windows7 x64 SP1(clean)、Scratch disk free space is 100GB
email: [email protected]Hi,
As far as i know that's a bug that will hopefully be fixed in the next update to photoshop cc. -
How to generate graph of total CSV used space ?
hi ,
I want to generate graph of total Hyper-v CSV used space
we use scom and i can get graph of each volume individually.
I want to create a summation graph to know average growth rate
Ramy ShakerI don't think this (http://gallery.technet.microsoft.com/scriptcenter/HyperV-Dash-Board-VM-Disk-299bac7d) will give you a graph of the total, but you should
be able to look at the code and create your own summation. What you are asking for is something that would be custom, so you are likely to have to create it on your own. At least Shabarinath has written PowerShell code to get the information you
want to summarize.
. : | : . : | : . tim -
Workflow scanning - Use space in file name
I configured two Xerox printers (WC 5875 and W 7835), with latest fimware installed, to scan on a windows shared folder using SMB protocol.The scan is working normally. But users experience this "interface" issue: is not possible to use SPACE character on the file name. The space bar is disabled on the printer screen when users try to modify the standard file name. Is it a software limitation? Is it related with SMB protocol? Is it possible to enable space in file name? Thanks in advance for assistance. CLAUDIO
If the current firmware begins with 072, upgrade to this one here and the option will be enabled for the space bar. 58xx devices 7830 and 7835 If the current software/Firmware begins with 071, I highly suggest a tech call be placed to have an Altboot no data backup no clone to those levels, the increment that changes from 071-072 is major, it is the change from Connectkey 1.0 to 1.5, and when done, due to extensive changes, does not at all play well with updates or clone files.
-
Batch file to "Disable" un-used plug-ins etc.
Hi Folks!!
I've got into the habit (from the good old, small PC, WinXP days) of disabling with the pre-fix ~ (tilde) method, all the presets and plug-ins that I never use as soon as I install Photoshop.
Doing it manually in those days was not too much of a hardship as maybe, at worst twice a year.
Now that I've upgraded(?) to Win7, I must have done a "clean" system re-install at least once a month, the manual method is getting a bit tedious.
I'd like to have batch script(s) to automate/semi-automate the process so that I could open a command prompt at the root (C:\) and tell it to go to the swatches folder and prefix A, C, and D leaving B, E, and F untouched, then move on to the brushes folder, patterns folder, plug-ins folder etc. etc..
I've got a list of my usual "suspects", I've tried to write one myself (with no knowledge of what I'm doing) and so far I've managed to (luckily, but not repeated!!) get the first one on the list renamed followed by 50 or so "The *** path is not recognised/ The *** path is not a correct command/ The syntax is incorrect/ That's not your dog on your path" etc. etc.
Is this at all possible? I'd settle for several batch files, one for each folder, that I could just type their names in whilst looking at my pretty desktop instead of traipsing through the system folders, if that's what it takes.
HELP!!
Yours
Raggedy Round The Edges
Elmer (very) B. Fuddled
Message was edited by: Elmer B. Fuddled Speeling MistooksThanks for your response Noel,
A corrected link to M$ answers (maybe)
Originally i did do a lot of the "disabling" to save space when I was running WinXP on an old Packard Bell with a 60gb main HDD (don't laugh, that was an "upgrade" from the 20gb HDD!!) Now I've gone up in the world to Win7 with (to me) a huge 320gb HDD it's more an aesthetics / efficiency thing.
First example, the drop down window you get when you hit "Save As..."
I've never yet used any of the formats in PS high-lighted in green, the yellows are "very seldom used" and the rest, yes I do use. So if I can "hide" the ones I don't use, and I know I can't hide them all, the ones I do use are not hiding in a multitude of others.
When it comes to the Colour Swatches, not books, in the Preset Manager, after I've loaded my own "ICO" files it can get quite horrendous!!
The Full House
Now after I've removed all the Pantone etc. that I never touch, leaving only a couple I was "advised" to on t'interweb plus my own collection of palettes, some of which may only contain four colours..
Oooh!! I can see me canvas again!!
So much neater!
Bear in mind I'm not actually deleting anything so if I ever do need them, they are only a tilde away!!
I disable any plug-ins I don't, didn't or couldn't use when on WinXP due to hardware restraints (well the PC was salvaged from a skip!!) and I've managed to live without them.
The same sort of thing goes for the brushes, I've assembled my own .abr's from the supplied Adobe sets that I may only just use and disabled all the rest.
For brushes you can also read File Formats, Actions, Custom Shapes and Gradients
The script "Wot I Ave Wrote" looks like this (abridged)
@echo off cls
set windrive=%1
echo The Adobe installed Plug-ins and Presets listed in the "Read Me" file will
echo will be prepended with a tilde (~) which will disable/hide them.
echo.
echo Do you wish to continue?
set /p choice=Please press "Y" for yes or "N" for no:
if %choice%==y goto moveon
if %choice%==n goto dontmove
:moveonren "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\Cineon.8BI" "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\~Cineon.8BI"
ren "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\Dicom.8BI" "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\~Dicom.8BI"
ren "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\FastCore.8BX" "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\~FastCore.8BX"
ren "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\JPEG2000.8BI" "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\~JPEG2000.8BI"
ren "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\MMXCore.8BX" "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\~MMXCore.8BX"
ren "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\PBM.8BI" "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\~PBM.8BI"
ren "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\Pixar.8BI" "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\~Pixar.8BI"
ren "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\Radiance.8BI" "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\~Radiance.8BI"
ren "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\Standard MultiPlugin.8BF" "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\~Standard MultiPlugin.8BF"
ren "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\WBMP.8BI" "C:\PROGRAM FILES (X86)\ADOBE\ADOBE BRIDGE CS5\Plug-Ins\Import-Export\~FireWire Export.8BE"
echo .
echo .
echo Whoopy Doo!!! Won't be seeing those again unless you want to! :-)
echo .
pause
exit /B n
:dontmove
echo .
echo The Batch File execution has been cancelled.
pause
And that's about it, all the red bits I've borrowed from elsewhere so I'm none the wiser of what they really do!!
Any sites I've "visited" tell me that /1 /2 %WhoKnows% does "X", but not why it does!! So I gave up
Oh, BTW, using bridge as my guinea-pig as I never use it.
Could never get it to run on me XP machine so I looked elsewhere and I've never looked back again.
Regards
Elmer (more bemused than)B. Fuddled
Message was edited by: Elmer B. Fuddled Resizing images -
Hey guys,
This is my 2nd W530. The first one was replaced for the same issues I'm having now.
My wifi is very slow and inconsistent. I'm always having to disconnect and re-connect with my router (brand new router since I thought the old one could be the issue). This has been an issue since I received my new unit.
Yesterday I had a yellow exclamation mark pop up in Lenovo manager and said my network monitor WAN miniport was disabled (code 31). Since that popped up connecting to the wifi is very rare and requires a lot of effort. I'm out of ideas and considering calling Lenovo and having them take this thing back and give me a refund.
Anyone else experienced these issues? I tried windows 8 troubleshooter and it detects the issue but can't fix it. I tried updating the driver and it tells me its up to date and I tried uninstalling it and I'm unable to.Thanks for that, it's actually exactly what I wanted to read
Again, which WLAN adapter do you have in the system please?
When I read your post yesterday I took a look in my device manager and it was showing exactly the same problem which hadn't been present two days ago. It's something I've been keeping an eye on because I have the Intel Centrino Advanced N-6205 WLAN card which seems to be having problems being reported all over the web.
Trouble shooting to date,
after rolling back my Windows 8 X64 to the 15th May, before running Windows Updates, the WAN miniport problem had gone away. I then started trying to narrow things down by installing / uninstalling various updates and drivers.
At the moment I am at the stage that I can roll back the system to the 15th May, (no problem), and then install through Windows Update "Update for Windows 8 for x64-based Systems (KB2836988)" on it's own and immediately after a restart the WAN miniport problem is there again.
I have as yet been unable to get rid of the error by uninstalling the update, uninstalling / reinstalling drivers and various other softwares which could be a factor, but haven't given up yet.
Any chance you could roll back your system to a point where the error wasn't showing in Device Manager and see if you can replicate what I have experienced by just installing the one update?
Edit; for the record I am using a T430 W8 x64.
Andy ______________________________________
Please remember to come back and mark the post that you feel solved your question as the solution, it earns the member + points
Did you find a post helpfull? You can thank the member by clicking on the star to the left awarding them Kudos Please add your type, model number and OS to your signature, it helps to help you. Forum Search Option T430 2347-G7U W8 x64, Yoga 10 HD+, Tablet 1838-2BG, T61p 6460-67G W7 x64, T43p 2668-G2G XP, T23 2647-9LG XP, plus a few more. FYI Unsolicited Personal Messages will be ignored.
Deutsche Community Comunidad en Español English Community Русскоязычное Сообщество
PepperonI blog -
Disable Multiple temp space in OEM 12C
Hi,
I've centralized OEM 12C for monitoring. I want to disable the monitoring of multiple temp space.
i've disabled default temporary tablespace and undo tablespace of the test database in OEM 12c. But it is not covering for multiple temporary tablespaces.
Is it possible for disable multiple temp space? any other way?
Thanks in advance.
Thanks,
RobinRobin,
You can do a "Create Like" on the DISABLE TABLESPACE USED (%) ALERTS FOR UNDO AND TEMP TABLESPACES job and modify the sql listed below, which is used for the cursor, to something that will work for your temporary tablespaces.
select tablespace_name from dba_tablespaces where CONTENTS IN ('UNDO', 'TEMPORARY');
Regards,
- Loc -
[b]Tutorial:[/b] Simplify Developing OLE Automation Code Using VBA
INTRODUCTION
Automating Office applications from Oracle Forms can be a tedious, frustrating, and time-consuming process. Because the OLE2 and CLIENT_OLE2 built-ins do not validate the automation commands that they relay, code that compiles without errors often dies at runtime with a not-so-helpful error code. This tutorial will demonstrate how to simplify the development of automation code using a tool that ships with all Microsoft Office editions -- the Visual Basic for Applications (VBA) IDE.
The VBA IDE, a core Office component, is a full-fledged development environment featuring code completion, basic syntax highlighting, context-driven help and a runtime debugger. Its Object Browser provides a convenient means of browsing the Word object model, as well as searching by keyword.
For those who may not interested in following this tutorial in detail, I would like to stress the usefulness of the Object Browser as a tool for inspecting the functions supported by OLE server applications and, perhaps more importantly, valid values for function arguments. Whether/not anyone buys the assertion that starting with VBA prototypes is far more productive than pounding out OLE2 code from the very start, they will find the Object Browser invaluable as a reference -- I rely on it exclusively for this sort of documentation.
A BRIEF INTRODUCTION TO THE VBA IDE & THE OBJECT BROWSER UTILITY
Try this:
1. Open Word
2. Launch the VBA IDE by pressing <Alt><F11>
3. Open the Object Browser by pressing <F2>
The Object Browser allows you to visually navigate Word's class hierarchy. Its user interface is a bit crowded, so controls are unlabeled. Hovering the mouse cursor above a control will display a tooltip explaining that control's purpose. The browser's scope can be narrowed by using the Project/Library combo. Typing a keyword or substring in the Search Text combo and clicking on the Search button will cause all classes/members whose name contains the specified search text to be listed in the Search Results pane. Selecting an item from this list will update the two panes below it, showing the selected class, and its members. Beneath the Classes and Members panes is an untitled pane, gray in color, which displays details for the selected class/member, including hyperlinks to relevant information such as arguments, their types and allowable values. If Visual Basic Help is installed, pressing <F1> will display help on a selected class/member. (This feature can be installed from your Office install CD, if necessary.)
NOTE: While it is possible to cut-and-paste the code examples that follow, I highly recommend that they be typed in by hand. Doing so will provide a better understanding of how the IDE's code completion behaves. Use code completion most efficiently by not using the mouse or <Enter> key when selecting from completion lists. Instead, just type enough letters to select the desired list element, then continue along as if you had typed the entire element, typing the next operator in your statement. It really is slick!
HELLO WORLD - VBA-STYLE
1. Open Word
2. Launch the VBA IDE by pressing <Alt><F11>
3. Select Module from the Insert menu.
4. In the blank area that appears, enter the following code:
Public Sub HelloWorld()
Documents.Add
Selection.TypeText ("Hello, world!")
End Sub5. Press <F5> to run the code.
If you switch back to Word by pressing <Alt><F11>, there should appear a newly-created document containing the text Hello, world!.
A MORE AMBITIOUS EXAMPLE
In this example, we will launch Word, type some text, and alter its formatting. For the purposes of this tutorial, consider it the process we wish to automate from within Forms.
1. If Word is running, close it.
2. Open any Office application except Word, such as Excel, Outlook or PowerPoint
3. Launch the VBA IDE by pressing <Alt><F11>.
4. Select References from the Tools menu -- a dialog should pop up.
5. From within this dialog, locate and select Microsoft Word <version> Object Library, then click OK.
6. Select Module from the Insert menu.
7. In the blank area that appears, enter the following code:
Public Sub LaunchWord()
Dim app As Word.Application
Set app = CreateObject("Word.Application")
app.Visible = True '!!! IMPORTANT !!!
app.Documents.Add
With app.Selection
.TypeText "This is paragraph 1."
.TypeParagraph
.TypeText "This is paragraph 2."
.TypeParagraph
.TypeText "This is paragraph 3."
End With
With ActiveDocument
.Paragraphs(1).Range.Words(3).Bold = True
.Paragraphs(2).Range.Words(3).Italic = True
.Paragraphs(3).Range.Words(3).Underline = True
End With
End Sub8. Press <F5> to run the code.
A new Word session should have been launched. Switch to it, to view the results of our handiwork!
TAILORING VBA CODE INTENDED FOR OLE2 CONVERSION
Now, things get a bit uglier. The code listed above gives a good idea of how concise VBA code can be, but With blocks and chained object references do not translate readily into OLE2 code. Here's the same process, rewritten in a more OLE2-friendly style. Note the numerous intermediate object references that have been declared.
Public Sub LaunchWord()
Dim app As Word.Application
Dim doc As Word.Document
Dim docs As Word.Documents
Dim pars As Word.Paragraphs
Dim par As Word.Paragraph
Dim wrds As Word.Words
Dim sel As Word.Selection
Dim rng As Word.Range
Set app = CreateObject("Word.Application")
app.Visible = True '!!! IMPORTANT !!!
Set doc = app.Documents.Add
Set sel = app.Selection
sel.TypeText "This is paragraph 1."
sel.TypeParagraph
sel.TypeText "This is paragraph 2."
sel.TypeParagraph
sel.TypeText "This is paragraph 3."
Set pars = doc.Paragraphs
'select third word of first paragraph and make it bold
Set par = pars.Item(1)
Set rng = par.Range
Set wrds = rng.Words
Set rng = wrds.Item(3)
rng.Bold = True
'select third word of second paragraph and italicize it
Set par = pars.Item(2)
Set rng = par.Range
Set wrds = rng.Words
Set rng = wrds.Item(3)
rng.Italic = True
'select third word of second paragraph and underline it
Set par = pars.Item(3)
Set rng = par.Range
Set wrds = rng.Words
Set rng = wrds.Item(3)
rng.Underline = True
End Sub
TRANSFORMATION: CONVERTING VBA CODE INTO PL/SQL
Here is the PL/SQL counterpart to our previous VBA routine. Compare printouts of the two and note their similarities. Notice the need for argument lists -- this causes the code to fluff up quite a bit, and really interferes with readability.
PROCEDURE LAUNCH_WORD IS
v_app OLE2.OBJ_TYPE; -- Application
v_doc OLE2.OBJ_TYPE; -- Document
v_docs OLE2.OBJ_TYPE; -- Documents collection
v_pars OLE2.OBJ_TYPE; -- Paragraphs collection
v_par OLE2.OBJ_TYPE; -- Paragraph
v_wrds OLE2.OBJ_TYPE; -- Words collection
v_sel OLE2.OBJ_TYPE; -- Selection
v_rng OLE2.OBJ_TYPE; -- Range
v_args OLE2.LIST_TYPE; -- OLE2 argument list
BEGIN
/* launch Word and MAKE IT VISIBLE!!! */
v_app := OLE2.CREATE_OBJ('Word.Application');
OLE2.SET_PROPERTY(v_app, 'Visible', TRUE);
/* initialize key object references */
v_docs := OLE2.GET_OBJ_PROPERTY(v_app, 'Documents');
v_doc := OLE2.INVOKE_OBJ(v_docs, 'Add');
v_sel := OLE2.GET_OBJ_PROPERTY(v_app, 'Selection');
/* type first paragraph */
v_args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(v_args, 'This is paragraph 1.');
OLE2.INVOKE(v_sel, 'TypeText', v_args);
OLE2.DESTROY_ARGLIST(v_args);
OLE2.INVOKE(v_sel, 'TypeParagraph');
/* type second paragraph */
v_args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(v_args, 'This is paragraph 2.');
OLE2.INVOKE(v_sel, 'TypeText', v_args);
OLE2.DESTROY_ARGLIST(v_args);
OLE2.INVOKE(v_sel, 'TypeParagraph');
/* type third paragraph */
v_args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(v_args, 'This is paragraph 3.');
OLE2.INVOKE(v_sel, 'TypeText', v_args);
OLE2.DESTROY_ARGLIST(v_args);
/* set reference to Paragraphs collection */
v_pars := OLE2.GET_OBJ_PROPERTY(v_doc, 'Paragraphs');
/* select third word of first paragraph and make it bold */
v_args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(v_args, 1);
v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
OLE2.DESTROY_ARGLIST(v_args);
v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
v_args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(v_args, 3);
v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
OLE2.SET_PROPERTY(v_rng, 'Bold', TRUE);
/* select third word of second paragraph and italicize it */
v_args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(v_args, 2);
v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
OLE2.DESTROY_ARGLIST(v_args);
v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
v_args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(v_args, 3);
v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
OLE2.SET_PROPERTY(v_rng, 'Italic', TRUE);
/* select third word of second paragraph and underline it */
v_args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(v_args, 3);
v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
OLE2.DESTROY_ARGLIST(v_args);
v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
v_args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(v_args, 3);
v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
OLE2.SET_PROPERTY(v_rng, 'Underline', TRUE);
END;
REFACTORING FOR REUSABILITY AND READABILITY
While the previous procedure runs without errors, it suffers from poor readability which, in turn, makes it difficult to maintain. Here, we address those issues by moving repetetive low-level operations into separate procedures.
PROCEDURE LAUNCH_WORD IS
v_app OLE2.OBJ_TYPE; -- Application
v_doc OLE2.OBJ_TYPE; -- Document
v_docs OLE2.OBJ_TYPE; -- Documents collection
v_sel OLE2.OBJ_TYPE; -- Selection
v_args OLE2.LIST_TYPE; -- OLE2 argument list
BEGIN
/* launch Word and MAKE IT VISIBLE!!! */
v_app := OLE2.CREATE_OBJ('Word.Application');
OLE2.SET_PROPERTY(v_app, 'Visible', TRUE);
/* create a new Word document */
v_docs := OLE2.GET_OBJ_PROPERTY(v_app, 'Documents');
v_doc := OLE2.INVOKE_OBJ(v_docs, 'Add');
v_sel := OLE2.GET_OBJ_PROPERTY(v_app, 'Selection');
/* add a few paragraphs */
PRINT_PARAGRAPH(v_sel, 'This is paragraph 1.');
PRINT_PARAGRAPH(v_sel, 'This is paragraph 2.');
PRINT_PARAGRAPH(v_sel, 'This is paragraph 3.');
/* apply formatting */
APPLY_FORMATTING(v_doc, 1, 3, 'Bold', TRUE);
APPLY_FORMATTING(v_doc, 2, 3, 'Italic', TRUE);
APPLY_FORMATTING(v_doc, 3, 3, 'Underline', TRUE);
END;
PROCEDURE APPLY_FORMATTING(
v_doc OLE2.OBJ_TYPE,
v_paragraph_num NUMBER,
v_word_num NUMBER,
v_attribute VARCHAR2,
v_value BOOLEAN) IS
v_pars OLE2.OBJ_TYPE; -- Paragraphs collection
v_par OLE2.OBJ_TYPE; -- Paragraph
v_wrds OLE2.OBJ_TYPE; -- Words collection
v_rng OLE2.OBJ_TYPE; -- Range
v_args OLE2.LIST_TYPE; -- OLE2 argument list
BEGIN
/* set reference to Paragraphs collection */
v_pars := OLE2.GET_OBJ_PROPERTY(v_doc, 'Paragraphs');
/* get specified paragraph */
v_args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(v_args, v_paragraph_num);
v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
OLE2.DESTROY_ARGLIST(v_args);
/* get words for specified paragraph */
v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
/* apply formatting to word found at specified index */
v_args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(v_args, v_word_num);
v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
OLE2.SET_PROPERTY(v_rng, v_attribute, v_value);
END;
PROCEDURE PRINT_PARAGRAPH(v_sel OLE2.OBJ_TYPE, v_text VARCHAR2) IS
v_args OLE2.LIST_TYPE;
BEGIN
v_args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(v_args, v_text);
OLE2.INVOKE(v_sel, 'TypeText', v_args);
OLE2.DESTROY_ARGLIST(v_args);
OLE2.INVOKE(v_sel, 'TypeParagraph');
END;
CONCLUSION
It is my hope that this tutorial, despite it's introductory nature, has demonstrated the value of the VBA IDE, the ease with which automation processes can be prototyped using VBA, the noticeable similarity between VBA automation routines and their Forms PL/SQL counterparts, and the advantages of testing automation processes within the VBA IDE. Please feel free to follow up with any specific questions or concerns you may have.
Thanks,
Eric Adamson
Lansing, Michigan
FINAL NOTE: These examples use the OLE2 built-in, and will operate correctly when called from forms running in the Form Builder OC4J. Deploying them to an Oracle Application Server will launch Word on the server itself (if available), which is usually not the developer's intent! Automating Word client-side via web forms requires adding WebUtil support. Adapting the code for WebUtil is trivial -- just replace all instances of OLE2 with CLIENT_OLE2. Adapting forms for WebUtil and configuring OLE support into your Oracle Application Server, however, are beyond the scope of this tutorial.
REVISION HISTORY
This promises to be something of a 'living document'. I've snuck changes through without comment in the past, but in the future, I'll try to document significant changes here.
2006-08-21
* Prefaced boring subject line with text: 'Tutorial:' to clarify purpose
* Added emphasis on value of Object Browser as a referenceThanks James, for your kind words. I do hope this information will help folks out. I honestly believe that tinkering around in the VBA IDE will prove highly gratifying for automation developers. It can be assured that learning to make Word jump through hoops is much more straight-forward in this environment. I'm not one for mottos, but if I were pressed for a cheesy motto, I would say: First, make it work. Then, make it work in Oracle!
Once the idea has sunk in, that Visual Basic routines for automating Word are exact analogs to their OLE2 counterparts, we can remove keywords like Oracle and PL/SQL from our Google searches on Word automation which, at least in this context, are the proverbial kiss of death. Suddenly we find ourselves liberated by the possibility of steal-, ahem... borrowing ideas from the Visual Basic* community!
As for links, my link of choice is invariably http://groups.google.com -- if you don't already use it at least ten times a day, you must try it. This is the venerable USENET archive, including the holdings of now-extinct DejaNews. Another possible site of interest is http://word.mvps.org/FAQs/MacrosVBA, which may serve as a good starting point for those who wish to learn how to do fancy tricks with Word using VBA.
If these links don't prove immediately helpful, please feel free to give specifics on the sort of operations you are interested in automating, and I'll see if I can post an example that addresses it.
Regards,
Eric Adamson
Lansing, Michigan
PS: I do hope, as people read my posts, with every other acronym being VBA, that they are not mistakenly hearing a call to learn Visual Basic. I say this, not because I believe learning VB would be a Bad Thing, but because I assume that few of us feel we have the time to learn a new programming language. Despite having come to the Oracle camp already knowing VB/VBA, and having acquired a fair bit of experience with automating Office applications as an Access developer, I remain confident that what I am suggesting people attempt does not rise to the level of learning a language. What I am suggesting is that they learn enough of the language to get by.
*VB vs. VBA
Just a quick word on this, as readers may wonder why I seem to use these terms interchangeably. Visual Basic (VB) can refer to either a development platform or a programming language. Visual Basic for Applications (VBA) is a language -- more precisely, it is a subset of the Visual Basic language. One purchases VB, usually quite intentionally. VBA is included with Microsoft Office, as is VBA's development environment, the VBA IDE. The key distinction between VB and VBA is that VBA cannot be used to create self-contained executables. Rather, VBA relies on VBA-enabled applications, such as Microsoft Office applications, to serve as a container for VBA code, and to provide a runtime environment for that code. For the purposes of discussing OLE Automation, VB and VBA are quite interchangeable. -
Error in linking C++ STL code using CC 5.0 on Solaris 2.6
Hi All,
When building a shared dynamic library from C/C++ code using
STL features, I get an a link error, referring to the STL objects in
use.
I use CC WorkShop C++ Compiler 5.0 running on Solaris 2.6.
For example:
using a vector<int> we get :
Undefined Symbol
__1cDstdGvector4Cin0AJallocator4Ci___M__insert_aux6Mpirki_v_
In File aaa.o
using a multimap<int,int> we get :
Undefined Symbol
__1cH__rwstdJ__rb_tree4CinDstdEpair4CkiCi__n0AL__select1st4n0C_Ci__n0BEless4Ci__n0BJallocator4n0C____U__deallocate_buffers6M_v_
In File aaa.o
etc.
Switching (for testing) from shared lib to an exe does not seem
to solve this issue.
Same goes for toggling libCstd & libCrun's link mode (dyn/stat).
Any suggestions would be appreciated!
Thank you,
GiladHi Gilad,
I have a suggestion concerning the std::vector::__insert_aux error:
http://forum.java.sun.com/thread.jspa?forumID=850&threadID=5069680
Some recommended link options are provided in:
http://forum.java.sun.com/thread.jspa?forumID=850&threadID=5104725
Hope this is useful.
Bye. -
Creation of New company code using EC01
Hi
While creating a new company code using EC01, I am getting several messages relating to Number ranges. All the message relate to number range object type 5 & 6. After all these messages, the final message says that 86 number ranges have not been copied. Can some one throw some light on this?
Regards
RaviHi,
You can ignore these messages; if you use EC01 the system copies all possible tables that are registered as company-dependent. Some of these tables might be not in use at all.
Regards,
Eli
Maybe you are looking for
-
I recently dropped my Iphone 4s 32gig phone on the ground and the screen did not crack or anything. When i tried to slide to unlock it, nothing happened. It woudn't read my finger at all and the phone seemed fully functional (meaning i could click th
-
Org determination based on the Partner function
Dear Experts, I have a scenario where i need to determine the org data of an activity based on BP assignment in Org model. this BP is caluclated based on partner determination procedure which has got access sequence "Preceding Document: Activity Part
-
JMX error when starting managed server
One of our production managed servers has suddenly encountered an error when try to start it via the Admin console. No changes have been made recently that I am aware of. The port number for the node manager is available and the log files states that
-
Problem printing to PDF from IE 9 - some Fonts don't reproduce correctly.
When I print some pages to PDF from IE 9 some fonts print fine, but some seem scrambled. It's as though the real font has been replaced with a symbol font, or just random characters. If I copy and paste the apparently random text to Word, it is bac
-
Macbook Pro (2011 Model) suddenly does not boot from SSD in main bay
I have been using Macbook pro 2011 and Samsung SSD (256GB) for about a year. All of sudden, the computer will not from SSD from the main bay, but it will boot from the optical bay. I have tried an Intel SSD 120gb which came with the computer, but it